From reid at x10sys.com Mon Jul 9 00:21:40 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 05:21:40 -0000 Subject: [llvm-commits] [llvm-top] r38427 - /llvm-top/trunk/Makefile Message-ID: <200707090521.l695Lfnh017835@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 00:21:40 2007 New Revision: 38427 URL: http://llvm.org/viewvc/llvm-project?rev=38427&view=rev Log: Add some error handling so the build stops if there's an error. Modified: llvm-top/trunk/Makefile Modified: llvm-top/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/Makefile?rev=38427&r1=38426&r2=38427&view=diff ============================================================================== --- llvm-top/trunk/Makefile (original) +++ llvm-top/trunk/Makefile Mon Jul 9 00:21:40 2007 @@ -59,7 +59,7 @@ fi build: $(MODULE) install - @if test -f $(MODULEINFO); then \ + @if test -f $(MODULEINFO) ; then \ BuildTarget=`$(BUILDTARGET)` ; \ for mod in `$(DEPMODULES)`; do \ echo -n "NOTE: $(MODULE) module depends on $$mod" ; \ @@ -68,12 +68,14 @@ else \ echo ", checking it out now." ; \ $(MAKE) checkout MODULE=$$mod ; \ + if test "$$?" -ne 0 ; then exit 1 ; fi \ fi ; \ $(MAKE) build MODULE=$$mod ; \ + if test "$$?" -ne 0 ; then exit 1 ; fi \ done; \ fi ; \ echo "Building MODULE $(MODULE)" ; \ - root=`pwd` ; cd $(MODULE) ; $(MAKE) $$BuildTarget LLVM_TOP=$$root + root=`pwd` ; cd $(MODULE) ; $(MAKE) $$BuildTarget LLVM_TOP=$$root endif install: From reid at x10sys.com Mon Jul 9 00:22:55 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 05:22:55 -0000 Subject: [llvm-commits] [test-suite] r38428 - in /test-suite/trunk: Makefile ModuleInfo.txt Message-ID: <200707090522.l695MugH017868@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 00:22:55 2007 New Revision: 38428 URL: http://llvm.org/viewvc/llvm-project?rev=38428&view=rev Log: Set the test-suite up so it can be built from llvm-top. This doesn't work right now because llvm-gcc is not in the repository. Added: test-suite/trunk/ModuleInfo.txt Modified: test-suite/trunk/Makefile Modified: test-suite/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile?rev=38428&r1=38427&r2=38428&view=diff ============================================================================== --- test-suite/trunk/Makefile (original) +++ test-suite/trunk/Makefile Mon Jul 9 00:22:55 2007 @@ -16,3 +16,7 @@ PARALLEL_DIRS = SingleSource MultiSource External include $(LEVEL)/Makefile.programs + +build-for-llvm-top: + ./configure --with-llvmsrc=$(LLVM_TOP)/llvm --with-llvmobj=$(LLVM_TOP)/llvm --srcdir=$(LLVM_TOP)/test-suite --with-llvmgccdir=$(LLVM_TOP)/install --with-externals=$(LLVM_TOP)/externals + $(MAKE) Added: test-suite/trunk/ModuleInfo.txt URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ModuleInfo.txt?rev=38428&view=auto ============================================================================== --- test-suite/trunk/ModuleInfo.txt (added) +++ test-suite/trunk/ModuleInfo.txt Mon Jul 9 00:22:55 2007 @@ -0,0 +1,2 @@ +DepModule: llvm llvm-gcc +BuildTarget: build-for-llvm-top From reid at x10sys.com Mon Jul 9 00:33:45 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 05:33:45 -0000 Subject: [llvm-commits] [llvm] r38429 - /llvm/trunk/docs/CommandGuide/manpage.css Message-ID: <200707090533.l695Xj7Q018208@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 00:33:45 2007 New Revision: 38429 URL: http://llvm.org/viewvc/llvm-project?rev=38429&view=rev Log: Remove an unneeded space, mostly to verify that auto-update of the documentation is working. Modified: llvm/trunk/docs/CommandGuide/manpage.css Modified: llvm/trunk/docs/CommandGuide/manpage.css URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/manpage.css?rev=38429&r1=38428&r2=38429&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/manpage.css (original) +++ llvm/trunk/docs/CommandGuide/manpage.css Mon Jul 9 00:33:45 2007 @@ -13,7 +13,7 @@ .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; From reid at x10sys.com Mon Jul 9 00:52:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 05:52:49 -0000 Subject: [llvm-commits] [llvm] r38430 - /llvm/trunk/docs/CommandGuide/llvmc.pod Message-ID: <200707090552.l695qnpO018874@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 00:52:49 2007 New Revision: 38430 URL: http://llvm.org/viewvc/llvm-project?rev=38430&view=rev Log: Fix some minor typos, again to test the auto-update of the web site. Modified: llvm/trunk/docs/CommandGuide/llvmc.pod Modified: llvm/trunk/docs/CommandGuide/llvmc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvmc.pod?rev=38430&r1=38429&r2=38430&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvmc.pod (original) +++ llvm/trunk/docs/CommandGuide/llvmc.pod Mon Jul 9 00:52:49 2007 @@ -145,7 +145,7 @@ This level of optimization specifies a balance between generating good code that will execute reasonably quickly and not spending too much time optimizing the code to get there. For example, this level of optimization may include -things like global common subexpression elimination, aggressive dead code +things like global common sub-expression elimination, aggressive dead code elimination, and scalar replication. =item B<-O3> (aggressive optimization) @@ -173,7 +173,7 @@ This is the same as B<-O5> except that it employs profile-guided re-optimization of the program after it has executed. Note that this implies -a single level of re-optimization based on runtime profile analysis. Once +a single level of re-optimization based on run time profile analysis. Once the re-optimization has completed, the profiling instrumentation is removed and final optimizations are employed. From reid at x10sys.com Mon Jul 9 00:58:08 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 05:58:08 -0000 Subject: [llvm-commits] [llvm] r38431 - /llvm/trunk/docs/CommandGuide/llvm-ld.pod Message-ID: <200707090558.l695w8QX019088@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 00:58:08 2007 New Revision: 38431 URL: http://llvm.org/viewvc/llvm-project?rev=38431&view=rev Log: Fix a typo. Modified: llvm/trunk/docs/CommandGuide/llvm-ld.pod Modified: llvm/trunk/docs/CommandGuide/llvm-ld.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-ld.pod?rev=38431&r1=38430&r2=38431&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-ld.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-ld.pod Mon Jul 9 00:58:08 2007 @@ -19,7 +19,7 @@ the output of LLVM front-end compilers and run "link time" optimizations (mostly the inter-procedural kind). -The B tools attemps to mimic the interface provided by the default +The B tools attempts to mimic the interface provided by the default system linker so that it can act as a I replacement. =head2 Search Order From reid at x10sys.com Mon Jul 9 01:01:20 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 06:01:20 -0000 Subject: [llvm-commits] [llvm] r38432 - /llvm/trunk/docs/CommandGuide/llvm-ld.pod Message-ID: <200707090601.l6961Kag019225@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 01:01:20 2007 New Revision: 38432 URL: http://llvm.org/viewvc/llvm-project?rev=38432&view=rev Log: Fix a typo. Modified: llvm/trunk/docs/CommandGuide/llvm-ld.pod Modified: llvm/trunk/docs/CommandGuide/llvm-ld.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-ld.pod?rev=38432&r1=38431&r2=38432&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-ld.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-ld.pod Mon Jul 9 01:01:20 2007 @@ -64,7 +64,7 @@ The B program has limited support for native code generation, when using the B<-native> or B<-native-cbe> options. Native code generation is -perfomed by converting the linked bytecode into native assembly (.s) or C code +performed by converting the linked bytecode into native assembly (.s) or C code and running the system compiler (typically gcc) on the result. =head1 OPTIONS From reid at x10sys.com Mon Jul 9 01:06:46 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 06:06:46 -0000 Subject: [llvm-commits] [llvm] r38433 - /llvm/trunk/docs/CommandGuide/llvm-link.pod Message-ID: <200707090606.l6966kMu019448@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 01:06:45 2007 New Revision: 38433 URL: http://llvm.org/viewvc/llvm-project?rev=38433&view=rev Log: Fix some typos. Modified: llvm/trunk/docs/CommandGuide/llvm-link.pod Modified: llvm/trunk/docs/CommandGuide/llvm-link.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-link.pod?rev=38433&r1=38432&r2=38433&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-link.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-link.pod Mon Jul 9 01:06:45 2007 @@ -27,14 +27,14 @@ =item B<-L> F Add the specified F to the library search path. When looking for -libraries, B will look in pathname for libraries. This option can be +libraries, B will look in path name for libraries. This option can be specified multiple times; B 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 will not overwrite an output -file if it alreadys exists. +file if it already exists. =item B<-o> F From reid at x10sys.com Mon Jul 9 01:14:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 06:14:11 -0000 Subject: [llvm-commits] [llvm] r38434 - /llvm/trunk/docs/CommandGuide/llvm-nm.pod Message-ID: <200707090614.l696EBlL019711@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 01:14:11 2007 New Revision: 38434 URL: http://llvm.org/viewvc/llvm-project?rev=38434&view=rev Log: Fix some minor typos. Modified: llvm/trunk/docs/CommandGuide/llvm-nm.pod Modified: llvm/trunk/docs/CommandGuide/llvm-nm.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-nm.pod?rev=38434&r1=38433&r2=38434&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-nm.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-nm.pod Mon Jul 9 01:14:11 2007 @@ -13,7 +13,7 @@ The B utility lists the names of symbols from the LLVM bytecode files, or B archives containing LLVM bytecode files, named on the command line. Each symbol is listed along with some simple information about its provenance. -If no filename is specified, or I<-> is used as a filename, B will +If no file name is specified, or I<-> is used as a file name, B will process a bytecode file on its standard input stream. B's default output format is the traditional BSD B output format. @@ -32,11 +32,11 @@ =item C -Common (multiple defs link together into one def) +Common (multiple definitions link together into one def) =item W -Weak reference (multiple defs link together into zero or one defs) +Weak reference (multiple definitions link together into zero or one definitions) =item t From reid at x10sys.com Mon Jul 9 01:31:51 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 06:31:51 -0000 Subject: [llvm-commits] [llvm] r38435 - /llvm/trunk/docs/index.html Message-ID: <200707090631.l696Vpu1020332@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 01:31:51 2007 New Revision: 38435 URL: http://llvm.org/viewvc/llvm-project?rev=38435&view=rev Log: Links for commands are now generated into /cmds/ URL. Modified: llvm/trunk/docs/index.html Modified: llvm/trunk/docs/index.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/index.html?rev=38435&r1=38434&r2=38435&view=diff ============================================================================== --- llvm/trunk/docs/index.html (original) +++ llvm/trunk/docs/index.html Mon Jul 9 01:31:51 2007 @@ -67,27 +67,27 @@
  • Developer Policy - The LLVM project's policy towards developers and their contributions.
  • -
  • LLVM Command Guide - A reference +
  • LLVM Command Guide - A reference manual for the LLVM command line utilities ("man" pages for LLVM tools).
    Current tools: - llvm-ar, - llvm-as, - llvm-dis, - llvm-extract, - llvm-ld, - llvm-link, - llvm-nm, - llvm-prof, - llvm-ranlib, - opt, - llc, - lli, - llvmc - llvm-gcc, - llvm-g++, - stkrc, - bugpoint, - llvm-bcanalyzer, + llvm-ar, + llvm-as, + llvm-dis, + llvm-extract, + llvm-ld, + llvm-link, + llvm-nm, + llvm-prof, + llvm-ranlib, + opt, + llc, + lli, + llvmc + llvm-gcc, + llvm-g++, + stkrc, + bugpoint, + llvm-bcanalyzer,
  • Frequently Asked Questions - A list of common From reid at x10sys.com Mon Jul 9 01:32:55 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 06:32:55 -0000 Subject: [llvm-commits] [llvm] r38436 - /llvm/trunk/docs/CommandGuide/index.html Message-ID: <200707090632.l696WtJw020373@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 01:32:55 2007 New Revision: 38436 URL: http://llvm.org/viewvc/llvm-project?rev=38436&view=rev Log: This dir does not appear under /docs anymore but under /cmds so use an absolute path to the llvm.css file. Modified: llvm/trunk/docs/CommandGuide/index.html Modified: llvm/trunk/docs/CommandGuide/index.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/index.html?rev=38436&r1=38435&r2=38436&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/index.html (original) +++ llvm/trunk/docs/CommandGuide/index.html Mon Jul 9 01:32:55 2007 @@ -3,7 +3,7 @@ LLVM Command Guide - + From reid at x10sys.com Mon Jul 9 01:42:22 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 06:42:22 -0000 Subject: [llvm-commits] [llvm] r38437 - /llvm/trunk/docs/CommandGuide/llvm-upgrade.pod Message-ID: <200707090642.l696gMWi020791@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 01:42:22 2007 New Revision: 38437 URL: http://llvm.org/viewvc/llvm-project?rev=38437&view=rev Log: Minor language change upgrader -> upgrade tool Modified: llvm/trunk/docs/CommandGuide/llvm-upgrade.pod Modified: llvm/trunk/docs/CommandGuide/llvm-upgrade.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-upgrade.pod?rev=38437&r1=38436&r2=38437&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-upgrade.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-upgrade.pod Mon Jul 9 01:42:22 2007 @@ -2,7 +2,7 @@ =head1 NAME -llvm-upgrade - LLVM assembly upgrader +llvm-upgrade - LLVM assembly upgrade tool =head1 SYNOPSIS @@ -10,7 +10,7 @@ =head1 DESCRIPTION -B is the LLVM assembly upgrader. It reads a file containing +B is the LLVM assembly upgrade tool. It reads a file containing human-readable LLVM assembly language, and upgrades that assembly to the current version of LLVM. If the input is in the form currently accepted by LLVM, then no upgrades are performed. From reid at x10sys.com Mon Jul 9 01:45:18 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 06:45:18 -0000 Subject: [llvm-commits] [llvm] r38438 - /llvm/trunk/docs/CommandGuide/llvm-bcanalyzer.pod Message-ID: <200707090645.l696jIUo020917@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 01:45:18 2007 New Revision: 38438 URL: http://llvm.org/viewvc/llvm-project?rev=38438&view=rev Log: Bytecode -> Bitcode Modified: llvm/trunk/docs/CommandGuide/llvm-bcanalyzer.pod Modified: llvm/trunk/docs/CommandGuide/llvm-bcanalyzer.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-bcanalyzer.pod?rev=38438&r1=38437&r2=38438&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-bcanalyzer.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-bcanalyzer.pod Mon Jul 9 01:45:18 2007 @@ -2,7 +2,7 @@ =head1 NAME -llvm-bcanalyzer - LLVM bytecode analyzer +llvm-bcanalyzer - LLVM bitcode analyzer =head1 SYNOPSIS @@ -10,12 +10,12 @@ =head1 DESCRIPTION -The B command is a small utility for analyzing bytecode files. -The tool reads a bytecode file (such as generated with the B tool) and -produces a statistical report on the contents of the byteocde file. The tool -can also dump a low level but human readable version of the bytecode file. +The B command is a small utility for analyzing bitcode files. +The tool reads a bitcode file (such as generated with the B 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 bytecode file format. Most LLVM users can just ignore +directly with the bitcode file format. Most LLVM users can just ignore this tool. If F is omitted or is C<->, then B reads its input @@ -33,14 +33,14 @@ =item B<-dump> -Causes B to dump the bytecode in a human readable format. This +Causes B 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 bytecode file. +the encoding of the bitcode file. =item B<-verify> Causes B to verify the module produced by reading the -bytecode. This ensures that the statistics generated are based on a consistent +bitcode. This ensures that the statistics generated are based on a consistent module. =item B<--help> @@ -61,18 +61,18 @@ =over -=item B +=item B -This just provides the name of the module for which bytecode analysis is being +This just provides the name of the module for which bitcode analysis is being generated. -=item B +=item B -The bytecode version (not LLVM version) of the file read by the analyzer. +The bitcode version (not LLVM version) of the file read by the analyzer. =item B -The size, in bytes, of the entire bytecode file. +The size, in bytes, of the entire bitcode file. =item B @@ -86,7 +86,7 @@ =item B 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 bytecode file. +Size. This is the size of the definitions of all types in the bitcode file. =item B @@ -122,13 +122,13 @@ is relative to File Size. Note that this value is also included in the Module Global Bytes. -=item B +=item B -The total number of blocks of any kind in the bytecode file. +The total number of blocks of any kind in the bitcode file. =item B -The total number of function definitions in the bytecode file. +The total number of function definitions in the bitcode file. =item B @@ -140,42 +140,42 @@ =item B -The total number of basic blocks defined in all functions in the bytecode file. +The total number of basic blocks defined in all functions in the bitcode file. =item B -The total number of instructions defined in all functions in the bytecode file. +The total number of instructions defined in all functions in the bitcode file. =item B -The total number of long instructions defined in all functions in the bytecode +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 -The total number of operands used in all instructions in the bytecode file. +The total number of operands used in all instructions in the bitcode file. =item B -The total number of compaction tables in all functions in the bytecode file. +The total number of compaction tables in all functions in the bitcode file. =item B -The total number of symbol tables in all functions in the bytecode file. +The total number of symbol tables in all functions in the bitcode file. =item B -The total number of dependent libraries found in the bytecode file. +The total number of dependent libraries found in the bitcode file. =item B -The total size of the instructions in all functions in the bytecode file. +The total size of the instructions in all functions in the bitcode file. =item B -The average number of bytes per instruction across all functions in the bytecode +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. @@ -306,7 +306,7 @@ =head1 SEE ALSO -L, L +L, L =head1 AUTHORS From resistor at mac.com Mon Jul 9 01:50:06 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 06:50:06 -0000 Subject: [llvm-commits] [llvm] r38439 - /llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Message-ID: <200707090650.l696o6RZ021109@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 01:50:06 2007 New Revision: 38439 URL: http://llvm.org/viewvc/llvm-project?rev=38439&view=rev Log: Start using a set representation that remembers the set of value numbers represented in the set. For the moment, this results in a slight performance decrease, but it lays the groundwork for future improvements. Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=38439&r1=38438&r2=38439&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Jul 9 01:50:06 2007 @@ -547,6 +547,52 @@ } //===----------------------------------------------------------------------===// +// ValueTable Class +//===----------------------------------------------------------------------===// + +class ValueNumberedSet { + private: + SmallPtrSet contents; + BitVector numbers; + public: + ValueNumberedSet() { numbers.resize(1); } + + typedef SmallPtrSet::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); } + size_t size() { return contents.size(); } + + void set(unsigned i) { + if (i >= numbers.size()) + numbers.resize(i+1); + + numbers.set(i); + } + + 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 //===----------------------------------------------------------------------===// @@ -562,9 +608,9 @@ ValueTable VN; std::vector createdExpressions; - std::map > availableOut; - std::map > anticipatedIn; - std::map > generatedPhis; + std::map availableOut; + std::map anticipatedIn; + std::map generatedPhis; // This transformation requires dominator postdominator info virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -576,46 +622,43 @@ // Helper fuctions // FIXME: eliminate or document these better - void dump(const SmallPtrSet& s) const; - void clean(SmallPtrSet& set, BitVector& presentInSet); - Value* find_leader(SmallPtrSet& vals, - uint32_t v); + 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(SmallPtrSet& anticIn, BasicBlock* pred, - BasicBlock* succ, SmallPtrSet& out); + void phi_translate_set(ValueNumberedSet& anticIn, BasicBlock* pred, + BasicBlock* succ, ValueNumberedSet& out); - void topo_sort(SmallPtrSet& set, + void topo_sort(ValueNumberedSet& set, std::vector& vec); void cleanup(); bool elimination(); - void val_insert(SmallPtrSet& s, Value* v); - void val_replace(SmallPtrSet& s, Value* v); + void val_insert(ValueNumberedSet& s, Value* v); + void val_replace(ValueNumberedSet& s, Value* v); bool dependsOnInvoke(Value* V); void buildsets_availout(BasicBlock::iterator I, - SmallPtrSet& currAvail, - SmallPtrSet& currPhis, - SmallPtrSet& currExps, - SmallPtrSet& currTemps, - BitVector& availNumbers, - BitVector& expNumbers); + ValueNumberedSet& currAvail, + ValueNumberedSet& currPhis, + ValueNumberedSet& currExps, + SmallPtrSet& currTemps); bool buildsets_anticout(BasicBlock* BB, - SmallPtrSet& anticOut, + ValueNumberedSet& anticOut, std::set& visited); unsigned buildsets_anticin(BasicBlock* BB, - SmallPtrSet& anticOut, - SmallPtrSet& currExps, + ValueNumberedSet& anticOut, + ValueNumberedSet& currExps, SmallPtrSet& currTemps, std::set& visited); void buildsets(Function& F); void insertion_pre(Value* e, BasicBlock* BB, std::map& avail, - std::map >& new_set); + std::map& new_set); unsigned insertion_mergepoint(std::vector& workList, df_iterator& D, - std::map >& new_set); + std::map& new_set); bool insertion(Function& F); }; @@ -638,8 +681,11 @@ /// 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(SmallPtrSet& vals, uint32_t v) { - for (SmallPtrSet::iterator I = vals.begin(), E = vals.end(); +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; @@ -649,16 +695,15 @@ /// 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(SmallPtrSet& s, Value* v) { +void GVNPRE::val_insert(ValueNumberedSet& s, Value* v) { uint32_t num = VN.lookup(v); - Value* leader = find_leader(s, num); - if (leader == 0) + 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(SmallPtrSet& s, Value* v) { +void GVNPRE::val_replace(ValueNumberedSet& s, Value* v) { uint32_t num = VN.lookup(v); Value* leader = find_leader(s, num); while (leader != 0) { @@ -867,14 +912,16 @@ } /// phi_translate_set - Perform phi translation on every element of a set -void GVNPRE::phi_translate_set(SmallPtrSet& anticIn, +void GVNPRE::phi_translate_set(ValueNumberedSet& anticIn, BasicBlock* pred, BasicBlock* succ, - SmallPtrSet& out) { - for (SmallPtrSet::iterator I = anticIn.begin(), + ValueNumberedSet& out) { + for (ValueNumberedSet::iterator I = anticIn.begin(), E = anticIn.end(); I != E; ++I) { Value* V = phi_translate(*I, pred, succ); - if (V != 0) + if (V != 0 && !out.test(VN.lookup_or_add(V))) { out.insert(V); + out.set(VN.lookup(V)); + } } } @@ -895,7 +942,7 @@ /// 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(SmallPtrSet& set, BitVector& presentInSet) { +void GVNPRE::clean(ValueNumberedSet& set) { std::vector worklist; worklist.reserve(set.size()); topo_sort(set, worklist); @@ -906,13 +953,13 @@ // Handle unary ops if (CastInst* U = dyn_cast(v)) { bool lhsValid = !isa(U->getOperand(0)); - lhsValid |= presentInSet.test(VN.lookup(U->getOperand(0))); + lhsValid |= set.test(VN.lookup(U->getOperand(0))); if (lhsValid) lhsValid = !dependsOnInvoke(U->getOperand(0)); if (!lhsValid) { set.erase(U); - presentInSet.flip(VN.lookup(U)); + set.reset(VN.lookup(U)); } // Handle binary ops @@ -921,18 +968,18 @@ User* U = cast(v); bool lhsValid = !isa(U->getOperand(0)); - lhsValid |= presentInSet.test(VN.lookup(U->getOperand(0))); + lhsValid |= set.test(VN.lookup(U->getOperand(0))); if (lhsValid) lhsValid = !dependsOnInvoke(U->getOperand(0)); bool rhsValid = !isa(U->getOperand(1)); - rhsValid |= presentInSet.test(VN.lookup(U->getOperand(1))); + rhsValid |= set.test(VN.lookup(U->getOperand(1))); if (rhsValid) rhsValid = !dependsOnInvoke(U->getOperand(1)); if (!lhsValid || !rhsValid) { set.erase(U); - presentInSet.flip(VN.lookup(U)); + set.reset(VN.lookup(U)); } // Handle ternary ops @@ -941,29 +988,29 @@ User* U = cast(v); bool lhsValid = !isa(U->getOperand(0)); - lhsValid |= presentInSet.test(VN.lookup(U->getOperand(0))); + lhsValid |= set.test(VN.lookup(U->getOperand(0))); if (lhsValid) lhsValid = !dependsOnInvoke(U->getOperand(0)); bool rhsValid = !isa(U->getOperand(1)); - rhsValid |= presentInSet.test(VN.lookup(U->getOperand(1))); + rhsValid |= set.test(VN.lookup(U->getOperand(1))); if (rhsValid) rhsValid = !dependsOnInvoke(U->getOperand(1)); bool thirdValid = !isa(U->getOperand(2)); - thirdValid |= presentInSet.test(VN.lookup(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); - presentInSet.flip(VN.lookup(U)); + set.reset(VN.lookup(U)); } // Handle varargs ops } else if (GetElementPtrInst* U = dyn_cast(v)) { bool ptrValid = !isa(U->getPointerOperand()); - ptrValid |= presentInSet.test(VN.lookup(U->getPointerOperand())); + ptrValid |= set.test(VN.lookup(U->getPointerOperand())); if (ptrValid) ptrValid = !dependsOnInvoke(U->getPointerOperand()); @@ -971,13 +1018,13 @@ for (GetElementPtrInst::op_iterator I = U->idx_begin(), E = U->idx_end(); I != E; ++I) if (varValid) { - varValid &= !isa(*I) || presentInSet.test(VN.lookup(*I)); + varValid &= !isa(*I) || set.test(VN.lookup(*I)); varValid &= !dependsOnInvoke(*I); } if (!ptrValid || !varValid) { set.erase(U); - presentInSet.flip(VN.lookup(U)); + set.reset(VN.lookup(U)); } } } @@ -985,10 +1032,10 @@ /// topo_sort - Given a set of values, sort them by topological /// order into the provided vector. -void GVNPRE::topo_sort(SmallPtrSet& set, std::vector& vec) { +void GVNPRE::topo_sort(ValueNumberedSet& set, std::vector& vec) { SmallPtrSet visited; std::vector stack; - for (SmallPtrSet::iterator I = set.begin(), E = set.end(); + for (ValueNumberedSet::iterator I = set.begin(), E = set.end(); I != E; ++I) { if (visited.count(*I) == 0) stack.push_back(*I); @@ -1089,9 +1136,9 @@ } /// dump - Dump a set of values to standard error -void GVNPRE::dump(const SmallPtrSet& s) const { +void GVNPRE::dump(ValueNumberedSet& s) const { DOUT << "{ "; - for (SmallPtrSet::iterator I = s.begin(), E = s.end(); + for (ValueNumberedSet::iterator I = s.begin(), E = s.end(); I != E; ++I) { DOUT << "" << VN.lookup(*I) << ": "; DEBUG((*I)->dump()); @@ -1168,37 +1215,32 @@ /// buildsets_availout - When calculating availability, handle an instruction /// by inserting it into the appropriate sets void GVNPRE::buildsets_availout(BasicBlock::iterator I, - SmallPtrSet& currAvail, - SmallPtrSet& currPhis, - SmallPtrSet& currExps, - SmallPtrSet& currTemps, - BitVector& availNumbers, - BitVector& expNumbers) { + ValueNumberedSet& currAvail, + ValueNumberedSet& currPhis, + ValueNumberedSet& currExps, + SmallPtrSet& currTemps) { // Handle PHI nodes if (PHINode* p = dyn_cast(I)) { - VN.lookup_or_add(p); - expNumbers.resize(VN.size()); - availNumbers.resize(VN.size()); + unsigned num = VN.lookup_or_add(p); currPhis.insert(p); + currPhis.set(num); // Handle unary ops } else if (CastInst* U = dyn_cast(I)) { Value* leftValue = U->getOperand(0); unsigned num = VN.lookup_or_add(U); - expNumbers.resize(VN.size()); - availNumbers.resize(VN.size()); if (isa(leftValue)) - if (!expNumbers.test(VN.lookup(leftValue))) { + if (!currExps.test(VN.lookup(leftValue))) { currExps.insert(leftValue); - expNumbers.set(VN.lookup(leftValue)); + currExps.set(VN.lookup(leftValue)); } - if (!expNumbers.test(VN.lookup(U))) { + if (!currExps.test(num)) { currExps.insert(U); - expNumbers.set(num); + currExps.set(num); } // Handle binary ops @@ -1209,24 +1251,22 @@ Value* rightValue = U->getOperand(1); unsigned num = VN.lookup_or_add(U); - expNumbers.resize(VN.size()); - availNumbers.resize(VN.size()); if (isa(leftValue)) - if (!expNumbers.test(VN.lookup(leftValue))) { + if (!currExps.test(VN.lookup(leftValue))) { currExps.insert(leftValue); - expNumbers.set(VN.lookup(leftValue)); + currExps.set(VN.lookup(leftValue)); } if (isa(rightValue)) - if (!expNumbers.test(VN.lookup(rightValue))) { + if (!currExps.test(VN.lookup(rightValue))) { currExps.insert(rightValue); - expNumbers.set(VN.lookup(rightValue)); + currExps.set(VN.lookup(rightValue)); } - if (!expNumbers.test(VN.lookup(U))) { + if (!currExps.test(num)) { currExps.insert(U); - expNumbers.set(num); + currExps.set(num); } // Handle ternary ops @@ -1240,28 +1280,26 @@ VN.lookup_or_add(U); unsigned num = VN.lookup_or_add(U); - expNumbers.resize(VN.size()); - availNumbers.resize(VN.size()); if (isa(leftValue)) - if (!expNumbers.test(VN.lookup(leftValue))) { + if (!currExps.test(VN.lookup(leftValue))) { currExps.insert(leftValue); - expNumbers.set(VN.lookup(leftValue)); + currExps.set(VN.lookup(leftValue)); } if (isa(rightValue)) - if (!expNumbers.test(VN.lookup(rightValue))) { + if (!currExps.test(VN.lookup(rightValue))) { currExps.insert(rightValue); - expNumbers.set(VN.lookup(rightValue)); + currExps.set(VN.lookup(rightValue)); } if (isa(thirdValue)) - if (!expNumbers.test(VN.lookup(thirdValue))) { + if (!currExps.test(VN.lookup(thirdValue))) { currExps.insert(thirdValue); - expNumbers.set(VN.lookup(thirdValue)); + currExps.set(VN.lookup(thirdValue)); } - if (!expNumbers.test(VN.lookup(U))) { + if (!currExps.test(num)) { currExps.insert(U); - expNumbers.set(num); + currExps.set(num); } // Handle vararg ops @@ -1271,47 +1309,43 @@ VN.lookup_or_add(U); unsigned num = VN.lookup_or_add(U); - expNumbers.resize(VN.size()); - availNumbers.resize(VN.size()); if (isa(ptrValue)) - if (!expNumbers.test(VN.lookup(ptrValue))) { + if (!currExps.test(VN.lookup(ptrValue))) { currExps.insert(ptrValue); - expNumbers.set(VN.lookup(ptrValue)); + currExps.set(VN.lookup(ptrValue)); } for (GetElementPtrInst::op_iterator OI = U->idx_begin(), OE = U->idx_end(); OI != OE; ++OI) - if (isa(*OI) && !expNumbers.test(VN.lookup(*OI))) { + if (isa(*OI) && !currExps.test(VN.lookup(*OI))) { currExps.insert(*OI); - expNumbers.set(VN.lookup(*OI)); + currExps.set(VN.lookup(*OI)); } - if (!expNumbers.test(VN.lookup(U))) { + if (!currExps.test(VN.lookup(U))) { currExps.insert(U); - expNumbers.set(num); + currExps.set(num); } // Handle opaque ops } else if (!I->isTerminator()){ VN.lookup_or_add(I); - expNumbers.resize(VN.size()); - availNumbers.resize(VN.size()); currTemps.insert(I); } if (!I->isTerminator()) - if (!availNumbers.test(VN.lookup(I))) { + if (!currAvail.test(VN.lookup(I))) { currAvail.insert(I); - availNumbers.set(VN.lookup(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, - SmallPtrSet& anticOut, + ValueNumberedSet& anticOut, std::set& visited) { if (BB->getTerminator()->getNumSuccessors() == 1) { if (BB->getTerminator()->getSuccessor(0) != BB && @@ -1325,22 +1359,28 @@ } } else if (BB->getTerminator()->getNumSuccessors() > 1) { BasicBlock* first = BB->getTerminator()->getSuccessor(0); - anticOut.insert(anticipatedIn[first].begin(), anticipatedIn[first].end()); + 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); - SmallPtrSet& succAnticIn = anticipatedIn[currSucc]; + ValueNumberedSet& succAnticIn = anticipatedIn[currSucc]; std::vector temp; - for (SmallPtrSet::iterator I = anticOut.begin(), + for (ValueNumberedSet::iterator I = anticOut.begin(), E = anticOut.end(); I != E; ++I) - if (find_leader(succAnticIn, VN.lookup(*I)) == 0) + if (!succAnticIn.test(VN.lookup(*I))) temp.push_back(*I); for (std::vector::iterator I = temp.begin(), E = temp.end(); - I != E; ++I) + I != E; ++I) { anticOut.erase(*I); + anticOut.reset(VN.lookup(*I)); + } } } @@ -1351,11 +1391,11 @@ /// 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, - SmallPtrSet& anticOut, - SmallPtrSet& currExps, + ValueNumberedSet& anticOut, + ValueNumberedSet& currExps, SmallPtrSet& currTemps, std::set& visited) { - SmallPtrSet& anticIn = anticipatedIn[BB]; + ValueNumberedSet& anticIn = anticipatedIn[BB]; unsigned old = anticIn.size(); bool defer = buildsets_anticout(BB, anticOut, visited); @@ -1364,32 +1404,26 @@ anticIn.clear(); - BitVector numbers(VN.size()); - for (SmallPtrSet::iterator I = anticOut.begin(), + for (ValueNumberedSet::iterator I = anticOut.begin(), E = anticOut.end(); I != E; ++I) { - unsigned num = VN.lookup_or_add(*I); - numbers.resize(VN.size()); - - if (isa(*I) && !numbers.test(num)) { - anticIn.insert(*I); - numbers.set(num); - } + anticIn.insert(*I); + anticIn.set(VN.lookup(*I)); } - for (SmallPtrSet::iterator I = currExps.begin(), + for (ValueNumberedSet::iterator I = currExps.begin(), E = currExps.end(); I != E; ++I) { - if (!numbers.test(VN.lookup_or_add(*I))) { + if (!anticIn.test(VN.lookup(*I))) { anticIn.insert(*I); - numbers.set(VN.lookup(*I)); + anticIn.set(VN.lookup(*I)); } } for (SmallPtrSet::iterator I = currTemps.begin(), E = currTemps.end(); I != E; ++I) { anticIn.erase(*I); - numbers.flip(VN.lookup(*I)); + anticIn.reset(VN.lookup(*I)); } - clean(anticIn, numbers); + clean(anticIn); anticOut.clear(); if (old != anticIn.size()) @@ -1401,7 +1435,7 @@ /// buildsets - Phase 1 of the main algorithm. Construct the AVAIL_OUT /// and the ANTIC_IN sets. void GVNPRE::buildsets(Function& F) { - std::map > generatedExpressions; + std::map generatedExpressions; std::map > generatedTemporaries; DominatorTree &DT = getAnalysis(); @@ -1413,10 +1447,10 @@ E = df_end(DT.getRootNode()); DI != E; ++DI) { // Get the sets to update for this block - SmallPtrSet& currExps = generatedExpressions[DI->getBlock()]; - SmallPtrSet& currPhis = generatedPhis[DI->getBlock()]; + ValueNumberedSet& currExps = generatedExpressions[DI->getBlock()]; + ValueNumberedSet& currPhis = generatedPhis[DI->getBlock()]; SmallPtrSet& currTemps = generatedTemporaries[DI->getBlock()]; - SmallPtrSet& currAvail = availableOut[DI->getBlock()]; + ValueNumberedSet& currAvail = availableOut[DI->getBlock()]; BasicBlock* BB = DI->getBlock(); @@ -1425,16 +1459,14 @@ currAvail.insert(availableOut[DI->getIDom()->getBlock()].begin(), availableOut[DI->getIDom()->getBlock()].end()); - BitVector availNumbers(VN.size()); - for (SmallPtrSet::iterator I = currAvail.begin(), + for (ValueNumberedSet::iterator I = currAvail.begin(), E = currAvail.end(); I != E; ++I) - availNumbers.set(VN.lookup(*I)); - - BitVector expNumbers(VN.size()); + currAvail.set(VN.lookup(*I)); + for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) buildsets_availout(BI, currAvail, currPhis, currExps, - currTemps, availNumbers, expNumbers); + currTemps); } @@ -1450,7 +1482,7 @@ while (changed) { changed = false; - SmallPtrSet anticOut; + ValueNumberedSet anticOut; // Postorder walk of the CFG for (po_iterator BBI = po_begin(&F.getEntryBlock()), @@ -1491,11 +1523,11 @@ /// the main block void GVNPRE::insertion_pre(Value* e, BasicBlock* BB, std::map& avail, - std::map >& new_sets) { + std::map& new_sets) { for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI) { DOUT << "PRED: " << (*PI)->getName() << "\n"; Value* e2 = avail[*PI]; - if (!find_leader(availableOut[*PI], VN.lookup(e2))) { + if (!availableOut[*PI].test(VN.lookup(e2))) { User* U = cast(e2); Value* s1 = 0; @@ -1604,9 +1636,10 @@ VN.add(newVal, VN.lookup(U)); - SmallPtrSet& predAvail = availableOut[*PI]; + ValueNumberedSet& predAvail = availableOut[*PI]; val_replace(predAvail, newVal); val_replace(new_sets[*PI], newVal); + predAvail.set(VN.lookup(newVal)); std::map::iterator av = avail.find(*PI); if (av != avail.end()) @@ -1628,8 +1661,11 @@ 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; } @@ -1638,7 +1674,7 @@ /// block for the possibility of a partial redundancy. If present, eliminate it unsigned GVNPRE::insertion_mergepoint(std::vector& workList, df_iterator& D, - std::map >& new_sets) { + std::map& new_sets) { bool changed_function = false; bool new_stuff = false; @@ -1650,8 +1686,7 @@ isa(e) || isa(e) || isa(e) || isa(e) || isa(e) || isa(e)) { - if (find_leader(availableOut[D->getIDom()->getBlock()], - VN.lookup(e)) != 0) + if (availableOut[D->getIDom()->getBlock()].test(VN.lookup(e))) continue; std::map avail; @@ -1685,7 +1720,7 @@ } if (by_some && !all_same && - !find_leader(generatedPhis[BB], VN.lookup(e))) { + !generatedPhis[BB].test(VN.lookup(e))) { insertion_pre(e, BB, avail, new_sets); changed_function = true; @@ -1711,7 +1746,7 @@ DominatorTree &DT = getAnalysis(); - std::map > new_sets; + std::map new_sets; bool new_stuff = true; while (new_stuff) { new_stuff = false; @@ -1722,13 +1757,13 @@ if (BB == 0) continue; - SmallPtrSet& availOut = availableOut[BB]; - SmallPtrSet& anticIn = anticipatedIn[BB]; + ValueNumberedSet& availOut = availableOut[BB]; + ValueNumberedSet& anticIn = anticipatedIn[BB]; // Replace leaders with leaders inherited from dominator if (DI->getIDom() != 0) { - SmallPtrSet& dom_set = new_sets[DI->getIDom()->getBlock()]; - for (SmallPtrSet::iterator I = dom_set.begin(), + 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); From reid at x10sys.com Mon Jul 9 02:41:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 07:41:11 -0000 Subject: [llvm-commits] [llvm] r38440 - /llvm/trunk/utils/mkpatch Message-ID: <200707090741.l697fBbT022781@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 02:41:11 2007 New Revision: 38440 URL: http://llvm.org/viewvc/llvm-project?rev=38440&view=rev Log: Subversionify the script. Modified: llvm/trunk/utils/mkpatch Modified: llvm/trunk/utils/mkpatch URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/mkpatch?rev=38440&r1=38439&r2=38440&view=diff ============================================================================== --- llvm/trunk/utils/mkpatch (original) +++ llvm/trunk/utils/mkpatch Mon Jul 9 02:41:11 2007 @@ -18,9 +18,9 @@ fi NAME="$1" echo "mkpatch: Generating differences on top level files" -cvs diff -l -Ntdup -5 . > "$NAME".patch.raw 2>&1 +svn diff -N -x -u -N * > "$NAME".patch.raw 2>&1 echo "mkpatch: Generating differences on all directories" -cvs diff -Ntdup -5 >> "$NAME".patch.raw 2>&1 \ +svn diff -x -u >> "$NAME".patch.raw 2>&1 \ autoconf docs utils include lib/System lib/Support lib/VMCore lib/AsmParser \ lib/Bytecode lib/Analysis lib/Transforms lib/CodeGen lib/Target \ lib/ExecutionEngine lib/Debugger lib/Linker \ From resistor at mac.com Mon Jul 9 02:56:56 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 07:56:56 -0000 Subject: [llvm-commits] [llvm] r38441 - /llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Message-ID: <200707090756.l697uuUp023218@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 02:56:55 2007 New Revision: 38441 URL: http://llvm.org/viewvc/llvm-project?rev=38441&view=rev Log: Improve a hotspot that was making build_sets() slower by calling lookup() too often. This improves Anton's testcase from 36s to 32s. Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=38441&r1=38440&r2=38441&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Jul 9 02:56:55 2007 @@ -567,19 +567,23 @@ void erase(Value* v) { contents.erase(v); } size_t size() { return contents.size(); } - void set(unsigned i) { + void set(unsigned i) { if (i >= numbers.size()) numbers.resize(i+1); numbers.set(i); } - void reset(unsigned i) { + void copyNumbers(ValueNumberedSet& other) { + numbers = other.numbers; + } + + void reset(unsigned i) { if (i < numbers.size()) numbers.reset(i); } - bool test(unsigned i) { + bool test(unsigned i) { if (i >= numbers.size()) return false; @@ -622,44 +626,44 @@ // 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 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); + BasicBlock* succ, ValueNumberedSet& out) ; void topo_sort(ValueNumberedSet& set, - std::vector& vec); + std::vector& vec) ; - void cleanup(); - bool elimination(); + void cleanup() ; + bool elimination() ; - void val_insert(ValueNumberedSet& s, Value* v); - void val_replace(ValueNumberedSet& s, Value* v); - bool dependsOnInvoke(Value* V); + 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& currTemps); + SmallPtrSet& currTemps) ; bool buildsets_anticout(BasicBlock* BB, ValueNumberedSet& anticOut, - std::set& visited); + std::set& visited) ; unsigned buildsets_anticin(BasicBlock* BB, ValueNumberedSet& anticOut, ValueNumberedSet& currExps, SmallPtrSet& currTemps, - std::set& visited); - void buildsets(Function& F); + std::set& visited) ; + void buildsets(Function& F) ; void insertion_pre(Value* e, BasicBlock* BB, std::map& avail, - std::map& new_set); + std::map& new_set) ; unsigned insertion_mergepoint(std::vector& workList, df_iterator& D, - std::map& new_set); - bool insertion(Function& F); + std::map& new_set) ; + bool insertion(Function& F) ; }; @@ -1455,13 +1459,12 @@ BasicBlock* BB = DI->getBlock(); // A block inherits AVAIL_OUT from its dominator - if (DI->getIDom() != 0) - currAvail.insert(availableOut[DI->getIDom()->getBlock()].begin(), - availableOut[DI->getIDom()->getBlock()].end()); - - for (ValueNumberedSet::iterator I = currAvail.begin(), - E = currAvail.end(); I != E; ++I) - currAvail.set(VN.lookup(*I)); + if (DI->getIDom() != 0) { + currAvail.insert(availableOut[DI->getIDom()->getBlock()].begin(), + availableOut[DI->getIDom()->getBlock()].end()); + + currAvail.copyNumbers(availableOut[DI->getIDom()->getBlock()]); + } for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) From reid at x10sys.com Mon Jul 9 03:04:32 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:04:32 -0000 Subject: [llvm-commits] [llvm] r38442 - in /llvm/trunk/docs: CodingStandards.html DeveloperPolicy.html FAQ.html GettingStartedVS.html HowToReleaseLLVM.html HowToSubmitABug.html Makefile Projects.html ReleaseNotes.html Stacker.html TestingGuide.html index.html Message-ID: <200707090804.l6984YY7023671@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:04:31 2007 New Revision: 38442 URL: http://llvm.org/viewvc/llvm-project?rev=38442&view=rev Log: Subversionify the documentation. Modified: llvm/trunk/docs/CodingStandards.html llvm/trunk/docs/DeveloperPolicy.html llvm/trunk/docs/FAQ.html llvm/trunk/docs/GettingStartedVS.html llvm/trunk/docs/HowToReleaseLLVM.html llvm/trunk/docs/HowToSubmitABug.html llvm/trunk/docs/Makefile llvm/trunk/docs/Projects.html llvm/trunk/docs/ReleaseNotes.html llvm/trunk/docs/Stacker.html llvm/trunk/docs/TestingGuide.html llvm/trunk/docs/index.html Modified: llvm/trunk/docs/CodingStandards.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodingStandards.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/CodingStandards.html (original) +++ llvm/trunk/docs/CodingStandards.html Mon Jul 9 03:04:31 2007 @@ -122,9 +122,9 @@ File Headers -

    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 CVS. Most source trees will probably have a standard +

    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:

    Modified: llvm/trunk/docs/DeveloperPolicy.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DeveloperPolicy.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/DeveloperPolicy.html (original) +++ llvm/trunk/docs/DeveloperPolicy.html Mon Jul 9 03:04:31 2007 @@ -46,7 +46,7 @@
    1. Attract both users and developers to the LLVM project.
    2. Make life as simple and easy for contributors as possible.
    3. -
    4. Keep the top of tree CVS/SVN trees as stable as possible.
    5. +
    6. Keep the top of Subversion trees as stable as possible.

    This policy is aimed at frequent contributors to LLVM. People interested in @@ -93,16 +93,15 @@

    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:

      -
    1. Make your patch against the CVS HEAD (main development trunk), - not a branch, and not an old version of LLVM. This makes it easy to - apply the patch.
    2. +
    3. 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.
    4. 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.
    5. Patches should be made with this command: -
      cvs diff -Ntdup -5
      +
      svn diff -x -u
      or with the utility utils/mkpatch, which makes it easy to read the diff.
    6. @@ -141,8 +140,8 @@

      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 CVS write access can - approve it.

      + and give feedback on a patch, but only people with Subversion write access + can approve it.

      @@ -367,7 +366,7 @@ changes. Despite this, once set, the attribution of a file never changes. Revision control keeps an accurate history of contributions.
    7. Developers should maintain their entry in the - CREDITS.txt + CREDITS.txt file to summarize their contributions.
    8. Commit comments should contain correct attribution of the person who submitted the patch if that person is not the committer (i.e. when a Modified: llvm/trunk/docs/FAQ.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/FAQ.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/FAQ.html (original) +++ llvm/trunk/docs/FAQ.html Mon Jul 9 03:04:31 2007 @@ -39,8 +39,8 @@
    9. The configure script finds the right C compiler, but it uses the LLVM linker from a previous build. What do I do?
    10. When creating a dynamic library, I get a strange GLIBC error.
    11. -
    12. I've updated my source tree from CVS, and now my build is trying to use a - file/directory that doesn't exist.
    13. +
    14. I've updated my source tree from Subversion, and now my build is trying + to use a file/directory that doesn't exist.
    15. I've modified a Makefile in my source tree, but my build tree keeps using the old version. What do I do?
    16. I've upgraded to a new version of LLVM, and I get strange build @@ -50,7 +50,7 @@
    17. Compiling LLVM with GCC 3.3.2 fails, what should I do?
    18. When I use the test suite, all of the C Backend tests fail. What is wrong?
    19. -
    20. After CVS update, rebuilding gives the error "No rule to make +
    21. After Subversion update, rebuilding gives the error "No rule to make target".
    22. The llvmc program gives me errors/doesn't work.
    23. @@ -257,8 +257,8 @@
      -

      I've updated my source tree from CVS, and now my build is trying to use a -file/directory that doesn't exist.

      +

      I've updated my source tree from Subversion, and now my build is trying to + use a file/directory that doesn't exist.

      @@ -358,7 +358,8 @@
      -

      After CVS update, rebuilding gives the error "No rule to make target".

      +

      After Subversion update, rebuilding gives the error + "No rule to make target".

      @@ -372,9 +373,9 @@
      -

      This may occur anytime files are moved within the CVS repository or removed -entirely. In this case, the best solution is to erase all .d files, -which list dependencies for source files, and rebuild:

      +

      This may occur anytime files are moved within the Subversion repository or +removed entirely. In this case, the best solution is to erase all +.d files, which list dependencies for source files, and rebuild:

      @@ -409,11 +410,9 @@
         available through a special version of GCC that LLVM calls the 
         C Front End

      There is an incomplete version of a Java front end available in the - llvm-java CVS repository. There is no documentation on this yet so + java module. There is no documentation on this yet so you'll need to download the code, compile it, and try it.

      -

      In the examples/BFtoLLVM directory is a translator for the - BrainF*** language (2002 Language Specification).

      -

      In the projects/Stacker directory is a compiler and runtime +

      In the stacker module is a compiler and runtime library for the Stacker language, a "toy" language loosely based on Forth.

      The PyPy developers are working on integrating LLVM into the PyPy backend so that PyPy language can translate to LLVM.

      Modified: llvm/trunk/docs/GettingStartedVS.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStartedVS.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/GettingStartedVS.html (original) +++ llvm/trunk/docs/GettingStartedVS.html Mon Jul 9 03:04:31 2007 @@ -99,16 +99,13 @@
    24. cd llvm
  • -
  • With anonymous CVS access: +
  • With anonymous Subversion access:
    1. cd where-you-want-llvm-to-live
    2. -
    3. cvs -d - :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm login
    4. -
    5. Hit the return key when prompted for the password. -
    6. cvs -z3 -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm - co llvm
    7. +
    8. svn co http://llvm.org/svn/llvm-project/llvm-top/trunk llvm-top +
    9. +
    10. make checkout MODULE=llvm
    11. cd llvm
    12. -
    13. cvs up -P -d
  • @@ -128,8 +125,8 @@ -

    It is strongly encouraged that you get the latest version from CVS. Much -progress has been made since the 1.4 release.

    +

    It is strongly encouraged that you get the latest version from Subversion as +changes are continually making the VS support better.

    Modified: llvm/trunk/docs/HowToReleaseLLVM.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/HowToReleaseLLVM.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/HowToReleaseLLVM.html (original) +++ llvm/trunk/docs/HowToReleaseLLVM.html Mon Jul 9 03:04:31 2007 @@ -139,8 +139,7 @@ The Release Manager tags his/her llvm, llvm-test, and llvm-gcc working directories with "ROOT_RELEASE_XX" where XX is the major and minor - release numbers (you can't have . in a cvs tag name). So, for Release 1.2, - XX=12 and for Release 1.10, XX=110. + release numbers. So, for Release 1.2, XX=12 and for Release 1.10, XX=110.

    cvs tag ROOT_RELEASE_XX
    @@ -180,8 +179,8 @@

    After creating the llvm release branch, update the release branch's autoconf/configure.ac - version from X.Xcvs to just X.X. Update it on mainline as well to be the next version - (X.X+1cvs). + version from X.Xsvn to just X.X. Update it on mainline as well to be the next version + (X.X+1svn).

    @@ -316,8 +315,9 @@

    - Check out the llvm-www module from cvs. Create a new subdirectory X.X in the - releases directory. Place the llvm, llvm-test, llvm-gcc source, and llvm-gcc + Check out the website module from Subversion. Create a new + subdirectory X.X in the releases directory. Place the llvm, llvm-test, + llvm-gcc source, and llvm-gcc binaries in this new directory. Copy the llvm/docs and LICENSE.txt files into this new directory. Update the releases/download.html file with the new release. Update the releases/index.html with the new release. Finally, update the main page ( Modified: llvm/trunk/docs/HowToSubmitABug.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/HowToSubmitABug.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/HowToSubmitABug.html (original) +++ llvm/trunk/docs/HowToSubmitABug.html Mon Jul 9 03:04:31 2007 @@ -67,7 +67,7 @@

    • All information necessary to reproduce the problem.
    • The reduced test-case that triggers the bug.
    • -
    • The location where you obtained LLVM (if not from our CVS +
    • The location where you obtained LLVM (if not from our Subversion repository).
    Modified: llvm/trunk/docs/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Makefile?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/Makefile (original) +++ llvm/trunk/docs/Makefile Mon Jul 9 03:04:31 2007 @@ -14,7 +14,7 @@ PROJ_OBJ_DIR = . DOXYGEN = doxygen # Extract version number from the AC_INT line in configure.ac -# AC_INIT([[llvm]],[[2.1cvs]],[llvmbugs at cs.uiuc.edu]) +# AC_INIT([[llvm]],[[2.1svn]],[llvmbugs at cs.uiuc.edu]) PACKAGE_VERSION = $(shell grep AC_INIT ../autoconf/configure.ac | sed -e 's/^[^0-9]*\([0-9_.a-zA-Z-]*\).*/\1/' ) $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in Modified: llvm/trunk/docs/Projects.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Projects.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/Projects.html (original) +++ llvm/trunk/docs/Projects.html Mon Jul 9 03:04:31 2007 @@ -88,10 +88,10 @@ the name of your project.
  • -If you downloaded LLVM using CVS, remove all the directories named CVS (and all -the files therein) from your project's new source tree. This will keep CVS -from thinking that your project is inside llvm/projects/sample. -
  • +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 +llvm/trunk/projects/sample.
  • Add your source code and Makefiles to your source tree.
  • Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Mon Jul 9 03:04:31 2007 @@ -43,7 +43,8 @@ href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM developer's mailing list is a good place to send them.

    -

    Note that if you are reading this file from CVS or the main LLVM web page, +

    Note that if you are reading this file from a Subversion checkout or the +main LLVM web page, this document applies to the next release, not the current one. To see the release notes for the current or previous releases, see the releases page.

    @@ -832,8 +833,8 @@

    A wide variety of additional information is available on the LLVM web page, in particular in the documentation section. The web page also -contains versions of the API documentation which is up-to-date with the CVS -version of the source code. +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 "llvm/doc/" directory in the LLVM tree.

    Modified: llvm/trunk/docs/Stacker.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Stacker.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/Stacker.html (original) +++ llvm/trunk/docs/Stacker.html Mon Jul 9 03:04:31 2007 @@ -1303,8 +1303,9 @@ sure you have the llvm sources in llvm (see Getting Started) and then use these commands:
    -    cd llvm/projects
    -    cvs co llvm-stacker
    + svn co http://llvm.org/svn/llvm-project/llvm-top/trunk llvm-top + cd llvm-top + make build MODULE=stacker

    Under the projects/llvm-stacker directory you will find the implementation of the Stacker compiler, as follows:

    Modified: llvm/trunk/docs/TestingGuide.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/TestingGuide.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/TestingGuide.html (original) +++ llvm/trunk/docs/TestingGuide.html Mon Jul 9 03:04:31 2007 @@ -106,14 +106,14 @@
    -

    The tests are located in two separate CVS modules. The basic feature and -regression tests are in the main "llvm" module under the directory -llvm/test. A more comprehensive test suite that includes whole -programs in C and C++ is in the llvm-test module. This module should -be checked out to the llvm/projects directory. When you -configure the llvm module, the llvm-test module -will be automatically configured. Alternatively, you can configure the - llvm-test module manually.

    +

    The tests are located in two separate Subversion modules. The basic feature + and regression tests are in the main "llvm" module under the directory + llvm/test. A more comprehensive test suite that includes whole +programs in C and C++ is in the test-suite module. This module should +be checked out to the llvm/projects directory as llvm-test (for +historical purpose). When you configure the llvm module, +the llvm-test directory will be automatically configured. +Alternatively, you can configure the test-suite module manually.

    To run all of the simple tests in LLVM using DejaGNU, use the master Makefile in the llvm/test directory:

    @@ -140,7 +140,7 @@
     
     
     % cd llvm/projects
    -% cvs co llvm-test
    +% svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
     % cd llvm-test
     % ./configure --with-llvmsrc=$LLVM_SRC_ROOT --with-llvmobj=$LLVM_OBJ_ROOT
     % gmake
    @@ -201,7 +201,7 @@
     programs generated as well as the speed with which LLVM compiles, optimizes, and
     generates code.

    -

    All "whole program" tests are located in the llvm-test CVS +

    All "whole program" tests are located in the test-suite Subversion module.

    @@ -238,8 +238,8 @@ piece of LLVM assembly language code, often distilled from an actual application or benchmark.

    -
  • llvm-test -

    The llvm-test CVS module contains programs that can be compiled +

  • test-suite +

    The test-suite 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 @@ -617,8 +617,8 @@

    1. cd into the llvm/projects directory
    2. -
    3. check out the llvm-test module with:
      - cvs -d :pserver:anon at llvm.org:/var/cvs/llvm co -PR llvm-test
      +
    4. check out the test-suite module with:
      + svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
      This will get the test suite into llvm/projects/llvm-test
    5. configure the test suite. You can do this one of two ways:
        @@ -760,24 +760,15 @@ machine, take a look at the comments at the top of the utils/NewNightlyTest.pl file. If you decide to set up a nightly tester please choose a unique nickname and invoke utils/NewNightlyTest.pl -with the "-nickname [yournickname]" command line option. We usually run it -from a crontab entry that looks like this:

        +with the "-nickname [yournickname]" command line option. -
        -
        -5 3 * * *  $HOME/llvm/utils/NewNightlyTest.pl -parallel -nickname Nickname \
        -           $CVSROOT $HOME/buildtest $HOME/cvs/testresults
        -
        -
        - -

        Or, you can create a shell script to encapsulate the running of the script. +

        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:

         #!/bin/bash
         BASE=/proj/work/llvm/nightlytest
        -export CVSROOT=:pserver:anon at llvm.org:/var/cvs/llvm
         export BUILDDIR=$BASE/build 
         export WEBDIR=$BASE/testresults 
         export LLVMGCCDIR=/proj/work/llvm/cfrontend/install
        @@ -786,7 +777,7 @@
         cd $BASE
         cp /proj/work/llvm/llvm/utils/NewNightlyTest.pl .
         nice ./NewNightlyTest.pl -nice -release -verbose -parallel -enable-linscan \
        -   -nickname NightlyTester -noexternals 2>&1 > output.log
        +   -nickname NightlyTester -noexternals > output.log 2>&1 
         
        Modified: llvm/trunk/docs/index.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/index.html?rev=38442&r1=38441&r2=38442&view=diff ============================================================================== --- llvm/trunk/docs/index.html (original) +++ llvm/trunk/docs/index.html Mon Jul 9 03:04:31 2007 @@ -161,8 +161,7 @@ (tarball) -
      1. CVSWeb CVS Tree -Browser
      2. +
      3. ViewVC Repository Browser
      4. @@ -246,9 +245,9 @@ closed, and when people submit patches to be included in LLVM. It is higher volume than the LLVMdev list. -
      5. The CVS Commits +
      6. The Commits Archive: This list contains all commit messages that are made when LLVM -developers commit code changes to the CVS archive. It is useful for those who +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.
      7. From reid at x10sys.com Mon Jul 9 03:09:22 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:09:22 -0000 Subject: [llvm-commits] [llvm] r38443 - /llvm/trunk/autoconf/configure.ac Message-ID: <200707090809.l6989MA9023797@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:09:21 2007 New Revision: 38443 URL: http://llvm.org/viewvc/llvm-project?rev=38443&view=rev Log: cvs -> svn Modified: llvm/trunk/autoconf/configure.ac Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=38443&r1=38442&r2=38443&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Mon Jul 9 03:09:21 2007 @@ -31,7 +31,7 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([[llvm]],[[2.1cvs]],[llvmbugs at cs.uiuc.edu]) +AC_INIT([[llvm]],[[2.1svn]],[llvmbugs at 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. From reid at x10sys.com Mon Jul 9 03:10:08 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:10:08 -0000 Subject: [llvm-commits] [llvm] r38444 - /llvm/trunk/configure Message-ID: <200707090810.l698AAws023841@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:10:07 2007 New Revision: 38444 URL: http://llvm.org/viewvc/llvm-project?rev=38444&view=rev Log: Regenerate. Modified: llvm/trunk/configure Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=38444&r1=38443&r2=38444&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Mon Jul 9 03:10:07 2007 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for llvm 2.1cvs. +# Generated by GNU Autoconf 2.60 for llvm 2.1svn. # # Report bugs to . # @@ -715,8 +715,8 @@ # Identity of this package. PACKAGE_NAME='llvm' PACKAGE_TARNAME='-llvm-' -PACKAGE_VERSION='2.1cvs' -PACKAGE_STRING='llvm 2.1cvs' +PACKAGE_VERSION='2.1svn' +PACKAGE_STRING='llvm 2.1svn' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' ac_unique_file="lib/VMCore/Module.cpp" @@ -1452,7 +1452,7 @@ # 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.1cvs to adapt to many kinds of systems. +\`configure' configures llvm 2.1svn to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1518,7 +1518,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of llvm 2.1cvs:";; + short | recursive ) echo "Configuration of llvm 2.1svn:";; esac cat <<\_ACEOF @@ -1645,7 +1645,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -llvm configure 2.1cvs +llvm configure 2.1svn generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1661,7 +1661,7 @@ 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.1cvs, which was +It was created by llvm $as_me 2.1svn, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -34043,7 +34043,7 @@ # 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.1cvs, which was +This file was extended by llvm $as_me 2.1svn, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -34096,7 +34096,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -llvm config.status 2.1cvs +llvm config.status 2.1svn configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" From reid at x10sys.com Mon Jul 9 03:12:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:12:24 -0000 Subject: [llvm-commits] [hlvm] r38445 - /hlvm/trunk/LICENSE.txt Message-ID: <200707090812.l698COaY023916@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:12:24 2007 New Revision: 38445 URL: http://llvm.org/viewvc/llvm-project?rev=38445&view=rev Log: Update license for inclusion of HLVM into the LLVM family of projects. Modified: hlvm/trunk/LICENSE.txt Modified: hlvm/trunk/LICENSE.txt URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/LICENSE.txt?rev=38445&r1=38444&r2=38445&view=diff ============================================================================== --- hlvm/trunk/LICENSE.txt (original) +++ hlvm/trunk/LICENSE.txt Mon Jul 9 03:12:24 2007 @@ -1,19 +1,16 @@ ============================================================================== -LLVM Release License +HLVM Release License ============================================================================== -University of Illinois/NCSA -Open Source License +University of Illinois/NCSA Open Source License -Copyright (c) 2003-2007 University of Illinois at Urbana-Champaign. +Copyright (c) 2007 University of Illinois at Urbana-Champaign. All rights reserved. Developed by: - LLVM Team + Reid Spencer - University of Illinois at Urbana-Champaign - - http://llvm.org + http://hlvm.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 @@ -52,18 +49,9 @@ 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 +other licenses gives permission to use the names of the developers 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 -GNU Libc llvm/runtime/GCCLibraries/libc From reid at x10sys.com Mon Jul 9 03:31:14 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:31:14 -0000 Subject: [llvm-commits] [llvm] r38446 - /llvm/trunk/utils/cvsupdate Message-ID: <200707090831.l698VE8g024538@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:31:14 2007 New Revision: 38446 URL: http://llvm.org/viewvc/llvm-project?rev=38446&view=rev Log: Remove the cvsupdate script. Its no longer useful in the face of tools such as svn info and svn status. Removed: llvm/trunk/utils/cvsupdate Removed: llvm/trunk/utils/cvsupdate URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/cvsupdate?rev=38445&view=auto ============================================================================== --- llvm/trunk/utils/cvsupdate (original) +++ llvm/trunk/utils/cvsupdate (removed) @@ -1,75 +0,0 @@ -#!/bin/csh -f -# -# This script updates the entire tree, saves the output in cvs.out, -# and then separately prints out the files that had merge conflicts, -# those that were merged successfully, and those that are new. -# Note that this script uses "cvs update -P -d". -# -# USAGE: -# cvsupdate ## normal run -# cvsupdate -n ## run grep commands on output of the last run of cvs -# cvsupdate -h ## usage information -# - -set pstatus = 0 -onintr cleanup -alias usage 'echo "USAGE: $0:t [-h][-n]"; set pstatus = 1; goto cleanup' - -set doit = 1 -set printnew = 0 -unset options_done -while ( !( $?options_done ) && ($#argv > 0)) - switch ($argv[1]) - case -h : - usage - case -n : - set doit = 0; shift argv; breaksw - case -new : - set printnew = 1; shift argv; breaksw - default : - set options_done; breaksw - endsw -end - -if ($doit == 1) then - /bin/mv -f cvs.out cvs.out.bak >&/dev/null - cvs update -P -d >& cvs.out -## if ($status != 0) then -## echo "ERROR: CVS update failed: " -## cat cvs.out -## exit 1 - endif -else - echo ""; echo "NOT UPDATING FILES. RESULTS FROM LAST RUN:"; echo "" -endif - -echo ""; echo " FILES UPDATED:" -grep '^[UP] ' cvs.out - -echo ""; echo " UPDATE CONFLICTS OCCURRED FOR THE FOLLOWING FILES:" -grep '^C ' cvs.out - -echo ""; echo " NEW FILES THAT NEED TO BE COMMITTED:" -grep '^[AR] ' cvs.out - -echo ""; echo " FILES REMOVED FROM YOUR DIRECTORY:" -grep 'no longer in the repository' cvs.out - -echo ""; echo " FILES SUCCESSFULLY MERGED (or locally modified):" -grep '^M ' cvs.out - -echo ""; echo " NEW FILES AND DIRECTORIES:" -if ($printnew != 0) then - grep '^\?' cvs.out | & grep -v '\.bc' | grep -v Updating | grep -v cvsup | grep -v 'cvs.out' | grep -v gnumake.out | grep -v '\.mc$' | grep -v '\.s$' | grep -v '\.native' -else - echo '(USE "cvsupdate -n -new" TO SEE NEW FILES AND DIRECTORIES.)' -endif - -echo "" - - -#========================================================= -# CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED -#========================================================= -cleanup: - exit($pstatus) From reid at x10sys.com Mon Jul 9 03:34:38 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:34:38 -0000 Subject: [llvm-commits] [llvm] r38447 - in /llvm/trunk: ./ examples/Fibonacci/ examples/HowToUseJIT/ examples/ModuleMaker/ examples/ParallelJIT/ lib/Analysis/ lib/Analysis/IPA/ lib/Archive/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/ExecutionEngine/Interpreter/ lib/ExecutionEngine/JIT/ lib/Linker/ lib/Support/ lib/System/ lib/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CBackend/ lib/Target/IA64/ lib/Target/MSIL/ lib/Target/PowerPC/ lib/Target/S... Message-ID: <200707090834.l698Yde0024703@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:34:37 2007 New Revision: 38447 URL: http://llvm.org/viewvc/llvm-project?rev=38447&view=rev Log: Set the svn:ignore property to ignore the Debug, Release, and Release-Asserts sub-directories in all directories that build code. Modified: llvm/trunk/ (props changed) llvm/trunk/examples/Fibonacci/ (props changed) llvm/trunk/examples/HowToUseJIT/ (props changed) llvm/trunk/examples/ModuleMaker/ (props changed) llvm/trunk/examples/ParallelJIT/ (props changed) llvm/trunk/lib/Analysis/ (props changed) llvm/trunk/lib/Analysis/IPA/ (props changed) llvm/trunk/lib/Archive/ (props changed) llvm/trunk/lib/AsmParser/ (props changed) llvm/trunk/lib/Bitcode/Reader/ (props changed) llvm/trunk/lib/Bitcode/Writer/ (props changed) llvm/trunk/lib/CodeGen/ (props changed) llvm/trunk/lib/CodeGen/SelectionDAG/ (props changed) llvm/trunk/lib/ExecutionEngine/ (props changed) llvm/trunk/lib/ExecutionEngine/Interpreter/ (props changed) llvm/trunk/lib/ExecutionEngine/JIT/ (props changed) llvm/trunk/lib/Linker/ (props changed) llvm/trunk/lib/Support/ (props changed) llvm/trunk/lib/System/ (props changed) llvm/trunk/lib/Target/ (props changed) llvm/trunk/lib/Target/ARM/ (props changed) llvm/trunk/lib/Target/Alpha/ (props changed) llvm/trunk/lib/Target/CBackend/ (props changed) llvm/trunk/lib/Target/IA64/ (props changed) llvm/trunk/lib/Target/MSIL/ (props changed) llvm/trunk/lib/Target/PowerPC/ (props changed) llvm/trunk/lib/Target/Sparc/ (props changed) llvm/trunk/lib/Target/X86/ (props changed) llvm/trunk/lib/Transforms/Hello/ (props changed) llvm/trunk/lib/Transforms/IPO/ (props changed) llvm/trunk/lib/Transforms/Instrumentation/ (props changed) llvm/trunk/lib/Transforms/Scalar/ (props changed) llvm/trunk/lib/Transforms/Utils/ (props changed) llvm/trunk/lib/VMCore/ (props changed) llvm/trunk/projects/sample/ (props changed) llvm/trunk/projects/sample/lib/sample/ (props changed) llvm/trunk/projects/sample/tools/sample/ (props changed) llvm/trunk/tools/bugpoint/ (props changed) llvm/trunk/tools/llc/ (props changed) llvm/trunk/tools/lli/ (props changed) llvm/trunk/tools/llvm-ar/ (props changed) llvm/trunk/tools/llvm-as/ (props changed) llvm/trunk/tools/llvm-bcanalyzer/ (props changed) llvm/trunk/tools/llvm-db/ (props changed) llvm/trunk/tools/llvm-dis/ (props changed) llvm/trunk/tools/llvm-extract/ (props changed) llvm/trunk/tools/llvm-ld/ (props changed) llvm/trunk/tools/llvm-link/ (props changed) llvm/trunk/tools/llvm-nm/ (props changed) llvm/trunk/tools/llvm-prof/ (props changed) llvm/trunk/tools/llvm-ranlib/ (props changed) llvm/trunk/tools/llvm-stub/ (props changed) llvm/trunk/tools/llvm-upgrade/ (props changed) llvm/trunk/tools/llvm2cpp/ (props changed) llvm/trunk/tools/llvmc/ (props changed) llvm/trunk/tools/lto/ (props changed) llvm/trunk/tools/opt/ (props changed) llvm/trunk/utils/PerfectShuffle/ (props changed) llvm/trunk/utils/TableGen/ (props changed) llvm/trunk/utils/fpcmp/ (props changed) Propchange: llvm/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1,10 +1,3 @@ -mklib -Makefile.config -config.log -config.status -cvs.out -autom4te.cache -configure.out -LLVM-* -_distcheckdir -llvm.spec +Debug +Release +Release-Asserts Propchange: llvm/trunk/examples/Fibonacci/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/examples/HowToUseJIT/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/examples/ModuleMaker/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/examples/ParallelJIT/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Analysis/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Analysis/IPA/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Archive/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/AsmParser/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1,4 +1,3 @@ -llvmAsmParser.output -Lexer.cpp -llvmAsmParser.cpp -llvmAsmParser.h +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Bitcode/Reader/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Bitcode/Writer/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/CodeGen/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/CodeGen/SelectionDAG/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/ExecutionEngine/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/ExecutionEngine/Interpreter/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/ExecutionEngine/JIT/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Linker/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Support/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/System/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/ARM/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1 +1,3 @@ -*.inc +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/Alpha/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1 +1,3 @@ -*.inc +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/CBackend/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/IA64/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1 +1,3 @@ -*.inc +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/MSIL/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/PowerPC/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1,2 +1,3 @@ -.cvsignore -*.inc +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/Sparc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1 +1,3 @@ -*.inc +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Target/X86/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1,2 +1,3 @@ -.cvsignore -*.inc +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Transforms/Hello/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Transforms/IPO/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Transforms/Instrumentation/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Transforms/Scalar/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/Transforms/Utils/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/lib/VMCore/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/projects/sample/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1,4 +1,3 @@ -Makefile.common -config.log -config.status -mklib +Debug +Release +Release-Asserts Propchange: llvm/trunk/projects/sample/lib/sample/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/projects/sample/tools/sample/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/bugpoint/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llc/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/lli/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-ar/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-as/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-bcanalyzer/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-db/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-dis/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-extract/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-ld/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-link/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-nm/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-prof/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-ranlib/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-stub/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm-upgrade/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1,4 +1,3 @@ -UpgradeParser.output -UpgradeLexer.cpp -UpgradeParser.cpp -UpgradeParser.h +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvm2cpp/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/llvmc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1 +1,3 @@ -ConfigLexer.cpp +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/lto/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/tools/opt/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/utils/PerfectShuffle/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts Propchange: llvm/trunk/utils/TableGen/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -1,5 +1,3 @@ -FileParser.output -FileLexer.cpp -FileParser.cpp -FileParser.h - +Debug +Release +Release-Asserts Propchange: llvm/trunk/utils/fpcmp/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:34:37 2007 @@ -0,0 +1,3 @@ +Debug +Release +Release-Asserts From reid at x10sys.com Mon Jul 9 03:44:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:44:13 -0000 Subject: [llvm-commits] [llvm] r38448 - in /llvm/trunk: ./ lib/AsmParser/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CBackend/ projects/sample/ tools/llvm-upgrade/ tools/llvmc/ utils/TableGen/ Message-ID: <200707090844.l698iDKt025033@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:44:12 2007 New Revision: 38448 URL: http://llvm.org/viewvc/llvm-project?rev=38448&view=rev Log: Restore properties I accidentally deleted with the last commit. Modified: llvm/trunk/ (props changed) llvm/trunk/lib/AsmParser/ (props changed) llvm/trunk/lib/Target/ARM/ (props changed) llvm/trunk/lib/Target/Alpha/ (props changed) llvm/trunk/lib/Target/CBackend/ (props changed) llvm/trunk/projects/sample/ (props changed) llvm/trunk/tools/llvm-upgrade/ (props changed) llvm/trunk/tools/llvmc/ (props changed) llvm/trunk/utils/TableGen/ (props changed) Propchange: llvm/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,13 @@ Debug Release Release-Asserts +mklib +Makefile.config +config.log +config.status +cvs.out +autom4te.cache +configure.out +LLVM-* +_distcheckdir +llvm.spec Propchange: llvm/trunk/lib/AsmParser/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,7 @@ Debug Release Release-Asserts +llvmAsmParser.output +Lexer.cpp +llvmAsmParser.cpp +llvmAsmParser.h Propchange: llvm/trunk/lib/Target/ARM/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,4 @@ Debug Release Release-Asserts +*.inc Propchange: llvm/trunk/lib/Target/Alpha/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,4 @@ Debug Release Release-Asserts +*.inc Propchange: llvm/trunk/lib/Target/CBackend/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,4 @@ Debug Release Release-Asserts +*.inc Propchange: llvm/trunk/projects/sample/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,7 @@ Debug Release Release-Asserts +Makefile.common +config.log +config.status +mklib Propchange: llvm/trunk/tools/llvm-upgrade/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,7 @@ Debug Release Release-Asserts +UpgradeParser.output +UpgradeLexer.cpp +UpgradeParser.cpp +UpgradeParser.h Propchange: llvm/trunk/tools/llvmc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,4 @@ Debug Release Release-Asserts +ConfigLexer.cpp Propchange: llvm/trunk/utils/TableGen/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:44:12 2007 @@ -1,3 +1,7 @@ Debug Release Release-Asserts +FileParser.output +FileLexer.cpp +FileParser.cpp +FileParser.h From reid at x10sys.com Mon Jul 9 03:46:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:46:02 -0000 Subject: [llvm-commits] [llvm] r38449 - in /llvm/trunk/lib: Debugger/ Target/IA64/ Target/PowerPC/ Target/Sparc/ Target/X86/ Message-ID: <200707090846.l698k2Ep025096@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:46:01 2007 New Revision: 38449 URL: http://llvm.org/viewvc/llvm-project?rev=38449&view=rev Log: More svn:ignore property restorations. Modified: llvm/trunk/lib/Debugger/ (props changed) llvm/trunk/lib/Target/IA64/ (props changed) llvm/trunk/lib/Target/PowerPC/ (props changed) llvm/trunk/lib/Target/Sparc/ (props changed) llvm/trunk/lib/Target/X86/ (props changed) Propchange: llvm/trunk/lib/Debugger/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 9 03:46:01 2007 @@ -0,0 +1 @@ +Debug Propchange: llvm/trunk/lib/Target/IA64/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:46:01 2007 @@ -1,3 +1,4 @@ Debug Release Release-Asserts +*.inc Propchange: llvm/trunk/lib/Target/PowerPC/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:46:01 2007 @@ -1,3 +1,4 @@ Debug Release Release-Asserts +*.inc Propchange: llvm/trunk/lib/Target/Sparc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:46:01 2007 @@ -1,3 +1,4 @@ Debug Release Release-Asserts +*.inc Propchange: llvm/trunk/lib/Target/X86/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:46:01 2007 @@ -1,3 +1,4 @@ Debug Release Release-Asserts +*.inc From reid at x10sys.com Mon Jul 9 03:47:45 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:47:45 -0000 Subject: [llvm-commits] [llvm] r38450 - in /llvm/trunk: ./ lib/Debugger/ Message-ID: <200707090847.l698lkKL025141@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:47:45 2007 New Revision: 38450 URL: http://llvm.org/viewvc/llvm-project?rev=38450&view=rev Log: Add more svn:ignore property values. Modified: llvm/trunk/ (props changed) llvm/trunk/lib/Debugger/ (props changed) Propchange: llvm/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:47:45 2007 @@ -11,3 +11,6 @@ LLVM-* _distcheckdir llvm.spec +svn-commit.tmp +*.patch +*.patch.raw Propchange: llvm/trunk/lib/Debugger/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:47:45 2007 @@ -1 +1,3 @@ Debug +Release +Release-Asserts From reid at x10sys.com Mon Jul 9 03:49:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Jul 2007 08:49:26 -0000 Subject: [llvm-commits] [llvm] r38451 - /llvm/trunk/ Message-ID: <200707090849.l698nQ25025201@zion.cs.uiuc.edu> Author: reid Date: Mon Jul 9 03:49:26 2007 New Revision: 38451 URL: http://llvm.org/viewvc/llvm-project?rev=38451&view=rev Log: Update the svn:ignore property to eliminate all files that start with svn-commit. because there can be several of them. Modified: llvm/trunk/ (props changed) Propchange: llvm/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jul 9 03:49:26 2007 @@ -11,6 +11,6 @@ LLVM-* _distcheckdir llvm.spec -svn-commit.tmp +svn-commit.* *.patch *.patch.raw From ggreif at gmail.com Mon Jul 9 06:24:07 2007 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 09 Jul 2007 11:24:07 -0000 Subject: [llvm-commits] [llvm] r38452 - in /llvm/trunk/docs/CommandGuide: llc.pod lli.pod llvm-ar.pod llvm-as.pod llvm-config.pod llvm-dis.pod llvm-extract.pod llvm-ld.pod llvm-link.pod llvm-nm.pod llvm-prof.pod llvm-ranlib.pod llvm2cpp.pod llvmc.pod llvmgcc.pod llvmgxx.pod opt.pod stkrc.pod Message-ID: <200707091124.l69BO7OU032442@zion.cs.uiuc.edu> Author: ggreif Date: Mon Jul 9 06:24:05 2007 New Revision: 38452 URL: http://llvm.org/viewvc/llvm-project?rev=38452&view=rev Log: eliminated all references to 'bytecode' from .pod files Modified: llvm/trunk/docs/CommandGuide/llc.pod llvm/trunk/docs/CommandGuide/lli.pod llvm/trunk/docs/CommandGuide/llvm-ar.pod llvm/trunk/docs/CommandGuide/llvm-as.pod llvm/trunk/docs/CommandGuide/llvm-config.pod llvm/trunk/docs/CommandGuide/llvm-dis.pod llvm/trunk/docs/CommandGuide/llvm-extract.pod llvm/trunk/docs/CommandGuide/llvm-ld.pod llvm/trunk/docs/CommandGuide/llvm-link.pod llvm/trunk/docs/CommandGuide/llvm-nm.pod llvm/trunk/docs/CommandGuide/llvm-prof.pod llvm/trunk/docs/CommandGuide/llvm-ranlib.pod llvm/trunk/docs/CommandGuide/llvm2cpp.pod llvm/trunk/docs/CommandGuide/llvmc.pod llvm/trunk/docs/CommandGuide/llvmgcc.pod llvm/trunk/docs/CommandGuide/llvmgxx.pod llvm/trunk/docs/CommandGuide/opt.pod llvm/trunk/docs/CommandGuide/stkrc.pod Modified: llvm/trunk/docs/CommandGuide/llc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llc.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llc.pod (original) +++ llvm/trunk/docs/CommandGuide/llc.pod Mon Jul 9 06:24:05 2007 @@ -10,18 +10,18 @@ =head1 DESCRIPTION -The B command compiles LLVM bytecode into assembly language for a +The B 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 bytecode file, unless the B<-march> option is used to +determined from the input bitcode file, unless the B<-march> option is used to override the default. =head1 OPTIONS -If I is - or omitted, B reads LLVM bytecode from standard input. -Otherwise, it will read LLVM bytecode from I. +If I is - or omitted, B reads LLVM bitcode from standard input. +Otherwise, it will read LLVM bitcode from I. If the B<-o> option is omitted, then B will send its output to standard output if the input is from standard input. If the B<-o> option specifies -, @@ -48,13 +48,13 @@ =item B<-mtriple>=I -Override the target triple specified in the input bytecode file with the +Override the target triple specified in the input bitcode file with the specified string. =item B<-march>=I Specify the architecture for which to generate assembly, overriding the target -encoded in the bytecode file. See the output of B for a list of +encoded in the bitcode file. See the output of B for a list of valid architectures. By default this is inferred from the target triple or autodetected to the current architecture. Modified: llvm/trunk/docs/CommandGuide/lli.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/lli.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/lli.pod (original) +++ llvm/trunk/docs/CommandGuide/lli.pod Mon Jul 9 06:24:05 2007 @@ -2,7 +2,7 @@ =head1 NAME -lli - directly execute programs from LLVM bytecode +lli - directly execute programs from LLVM bitcode =head1 SYNOPSIS @@ -10,13 +10,13 @@ =head1 DESCRIPTION -B directly executes programs in LLVM bytecode format. It takes a program -in LLVM bytecode format and executes it using a just-in-time compiler, if one is +B 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 takes all of the same code generator options as L, but they are only effective when B is using the just-in-time compiler. -If I is not specified, then B reads the LLVM bytecode for the +If I is not specified, then B reads the LLVM bitcode for the program from standard input. The optional I specified on the command line are passed to the program as @@ -42,14 +42,14 @@ =item B<-mtriple>=I -Override the target triple specified in the input bytecode file with the +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 Specify the architecture for which to generate assembly, overriding the target -encoded in the bytecode file. See the output of B for a list of +encoded in the bitcode file. See the output of B for a list of valid architectures. By default this is inferred from the target triple or autodetected to the current architecture. Modified: llvm/trunk/docs/CommandGuide/llvm-ar.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-ar.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-ar.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-ar.pod Mon Jul 9 06:24:05 2007 @@ -13,7 +13,7 @@ The B command is similar to the common Unix utility, C. It archives several files together into a single file. The intent for this is -to produce archive libraries by LLVM bytecode that can be linked into an +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 generates a symbol table that makes linking faster because only the symbol table needs to be consulted, not each individual file member @@ -44,7 +44,7 @@ =item I -Since B is intended to archive bytecode files, the symbol table +Since B 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 @@ -78,7 +78,7 @@ When B prints out the verbose table of contents (C 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 bytecode file. An +the file is compressed. A 'B' means the file is an LLVM bitcode file. An 'S' means the file is the symbol table. =back @@ -123,7 +123,7 @@ Print files to the standard output. The F modifier applies to this operation. This operation simply prints the F indicated to the standard output. If no F are specified, the entire archive is printed. -Printing bytecode files is ill-advised as they might confuse your terminal +Printing bitcode files is ill-advised as they might confuse your terminal settings. The F

        operation never modifies the archive. =item q[Rfz] @@ -146,7 +146,7 @@ Print the table of contents. Without any modifiers, this operation just prints the names of the members to the standard output. With the F modifier, -B also prints out the file type (B=bytecode, Z=compressed, S=symbol +B 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 are specified, the listing is only for those files. If no F are specified, the table of contents for the @@ -196,9 +196,9 @@ =item [k] -Normally, B will not print the contents of bytecode files when the +Normally, B will not print the contents of bitcode files when the F

        operation is used. This modifier defeats the default and allows the -bytecode members to be printed. +bitcode members to be printed. =item [N] @@ -230,8 +230,8 @@ When inserting or replacing any file in the archive, compress the file first. This -modifier is safe to use when (previously) compressed bytecode files are added to -the archive; the compressed bytecode files will not be doubly compressed. +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 @@ -252,7 +252,7 @@ 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 -bytecode files in the archive. Using this modifier is more efficient that using +bitcode files in the archive. Using this modifier is more efficient that using L which also creates the symbol table. =item [S] @@ -363,7 +363,7 @@ =item offset - vbr encoded 32-bit integer -The offset item provides the offset into the archive file where the bytecode +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 Modified: llvm/trunk/docs/CommandGuide/llvm-as.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-as.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-as.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-as.pod Mon Jul 9 06:24:05 2007 @@ -11,7 +11,7 @@ =head1 DESCRIPTION B is the LLVM assembler. It reads a file containing human-readable -LLVM assembly language, translates it to LLVM bytecode, and writes the result +LLVM assembly language, translates it to LLVM bitcode, and writes the result into a file or to standard output. If F is omitted or is C<->, then B reads its input from @@ -48,7 +48,7 @@ Force overwrite. Normally, B will refuse to overwrite an output file that already exists. With this option, B -will overwrite the output file and replace it with new bytecode. +will overwrite the output file and replace it with new bitcode. =item B<--help> Modified: llvm/trunk/docs/CommandGuide/llvm-config.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-config.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-config.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-config.pod Mon Jul 9 06:24:05 2007 @@ -115,7 +115,7 @@ =item B -Includes either a native JIT or the bytecode interpreter. +Includes either a native JIT or the bitcode interpreter. =back Modified: llvm/trunk/docs/CommandGuide/llvm-dis.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-dis.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-dis.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-dis.pod Mon Jul 9 06:24:05 2007 @@ -11,7 +11,7 @@ =head1 DESCRIPTION The B command is the LLVM disassembler. It takes an LLVM -bytecode file and converts it into human-readable LLVM assembly language. +bitcode file and converts it into human-readable LLVM assembly language. If filename is omitted or specified as C<->, B reads its input from standard input. Modified: llvm/trunk/docs/CommandGuide/llvm-extract.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-extract.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-extract.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-extract.pod Mon Jul 9 06:24:05 2007 @@ -11,10 +11,10 @@ =head1 DESCRIPTION The B command takes the name of a function and extracts it from -the specified LLVM bytecode file. It is primarily used as a debugging tool to +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 bytecode of the specified function, +In addition to extracting the bitcode of the specified function, B will also remove unreachable global variables, prototypes, and unused types. @@ -30,11 +30,11 @@ Force overwrite. Normally, B will refuse to overwrite an output file that already exists. With this option, B -will overwrite the output file and replace it with new bytecode. +will overwrite the output file and replace it with new bitcode. =item B<--func> I -Extract the function named I from the LLVM bytecode. +Extract the function named I from the LLVM bitcode. =item B<--help> Modified: llvm/trunk/docs/CommandGuide/llvm-ld.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-ld.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-ld.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-ld.pod Mon Jul 9 06:24:05 2007 @@ -10,9 +10,9 @@ =head1 DESCRIPTION -The B tool takes a set of LLVM bytecode files and links them -together into a single LLVM bytecode file. The output bytecode file can be -another bytecode file or an executable bytecode program. Using additional +The B 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 is able to produce native code executables. The B tool is the main linker for LLVM. It is used to link together @@ -47,13 +47,13 @@ =head2 Link order -All object and bytecode files are linked first in the order they were +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 bytecode objects are always linked into the output +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 @@ -64,7 +64,7 @@ The B 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 bytecode into native assembly (.s) or C code +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 @@ -121,7 +121,7 @@ =item B<-link-as-library> -Link the bytecode files together as a library, not an executable. In this mode, +Link the bitcode files together as a library, not an executable. In this mode, undefined symbols will be permitted. =item B<-r> @@ -136,14 +136,14 @@ Generate a native machine code executable. -When generating native executables, B first checks for a bytecode +When generating native executables, B first checks for a bitcode version of the library and links it in, if necessary. If the library is missing, B skips it. Then, B links in the same libraries as native code. -In this way, B should be able to link in optimized bytecode +In this way, B 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 bytecode. +hasn't been converted to bitcode. =item B<-native-cbe> @@ -236,7 +236,7 @@ =item B<-post-link-opt>F -Run post-link optimization program. After linking is completed a bytecode file +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 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 @@ -254,7 +254,7 @@ =head1 ENVIRONMENT -The C environment variable is used to find bytecode +The C environment variable is used to find bitcode libraries. Any paths specified in this variable will be searched after the C<-L> options. Modified: llvm/trunk/docs/CommandGuide/llvm-link.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-link.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-link.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-link.pod Mon Jul 9 06:24:05 2007 @@ -10,8 +10,8 @@ =head1 DESCRIPTION -B takes several LLVM bytecode files and links them together into a -single LLVM bytecode file. It writes the output file to standard output, unless +B 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 attempts to load the input files from the current directory. If @@ -44,7 +44,7 @@ =item B<-d> If specified, B prints a human-readable version of the output -bytecode file to standard error. +bitcode file to standard error. =item B<--help> @@ -53,7 +53,7 @@ =item B<-v> Verbose mode. Print information about what B is doing. This -typically includes a message for each bytecode file linked in and for each +typically includes a message for each bitcode file linked in and for each library found. =back Modified: llvm/trunk/docs/CommandGuide/llvm-nm.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-nm.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-nm.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-nm.pod Mon Jul 9 06:24:05 2007 @@ -2,7 +2,7 @@ =head1 NAME -llvm-nm - list LLVM bytecode file's symbol table +llvm-nm - list LLVM bitcode file's symbol table =head1 SYNOPSIS @@ -10,11 +10,11 @@ =head1 DESCRIPTION -The B utility lists the names of symbols from the LLVM bytecode files, -or B archives containing LLVM bytecode files, named on the command line. +The B utility lists the names of symbols from the LLVM bitcode files, +or B 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 will -process a bytecode file on its standard input stream. +process a bitcode file on its standard input stream. B's default output format is the traditional BSD B output format. Each such output record consists of an (optional) 8-digit hexadecimal address, @@ -28,7 +28,7 @@ =item U -Named object is referenced but undefined in this bytecode file +Named object is referenced but undefined in this bitcode file =item C @@ -60,10 +60,10 @@ =back -Because LLVM bytecode files typically contain objects that are not considered to +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 does not print an address for any symbol, -even symbols which are defined in the bytecode file. +even symbols which are defined in the bitcode file. =head1 OPTIONS @@ -83,18 +83,18 @@ =item B<--defined-only> -Print only symbols defined in this bytecode file (as opposed to +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 bytecode files. +from other bitcode files. =item B<--undefined-only>, B<-u> -Print only symbols referenced but not defined in this bytecode file. +Print only symbols referenced but not defined in this bitcode file. =item B<--format=>I, B<-f> Modified: llvm/trunk/docs/CommandGuide/llvm-prof.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-prof.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-prof.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-prof.pod Mon Jul 9 06:24:05 2007 @@ -6,12 +6,12 @@ =head1 SYNOPSIS -B [I] [I] [I] +B [I] [I] [I] =head1 DESCRIPTION The B tool reads in an F file (which can -optionally use a specific file with the third program argument), a bytecode file +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. @@ -47,7 +47,7 @@ =head1 EXIT STATUS -B returns 1 if it cannot load the bytecode file or the profile +B returns 1 if it cannot load the bitcode file or the profile information. Otherwise, it exits with zero. =head1 AUTHOR Modified: llvm/trunk/docs/CommandGuide/llvm-ranlib.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-ranlib.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-ranlib.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-ranlib.pod Mon Jul 9 06:24:05 2007 @@ -14,7 +14,7 @@ adds or updates the symbol table in an LLVM archive file. Note that using the B modifier F is usually more efficient than running B which is only provided only for completness and compatibility. Unlike other -implementations of C, B indexes LLVM bytecode files, not +implementations of C, B indexes LLVM bitcode files, not native object modules. You can list the contents of the symbol table with the C command. Modified: llvm/trunk/docs/CommandGuide/llvm2cpp.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm2cpp.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm2cpp.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm2cpp.pod Mon Jul 9 06:24:05 2007 @@ -2,7 +2,7 @@ =head1 NAME -llvm2xpp - LLVM bytecode to LLVM C++ IR translator +llvm2xpp - LLVM bitcode to LLVM C++ IR translator =head1 SYNOPSIS @@ -10,7 +10,7 @@ =head1 DESCRIPTION -B translates from LLVM bytecode (.bc files) to a +B translates from LLVM bitcode (.bc files) to a corresponding C++ source file that will make calls against the LLVM C++ API to build the same module as the input. By default, the C++ output is a complete program that builds the module, verifies it and then emits the module as Modified: llvm/trunk/docs/CommandGuide/llvmc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvmc.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvmc.pod (original) +++ llvm/trunk/docs/CommandGuide/llvmc.pod Mon Jul 9 06:24:05 2007 @@ -69,13 +69,13 @@ =item * Pre-processing: gathering/filtering compiler input (optional). -=item * Translation: source language to bytecode conversion. +=item * Translation: source language to bitcode conversion. -=item * Assembly: bytecode to native code conversion. +=item * Assembly: bitcode to native code conversion. -=item * Optimization: conversion of bytecode to something that runs faster. +=item * Optimization: conversion of bitcode to something that runs faster. -=item * Linking: combining multiple bytecodes to produce executable program. +=item * Linking: combining multiple bitcode files to produce executable program. =back @@ -99,7 +99,7 @@ This option specifies that the linking phase is not to be run. All previous phases, if applicable will run. This is generally how a given -bytecode file is compiled and optimized for a source language module. +bitcode file is compiled and optimized for a source language module. =item B<-k> or B<--link> or default @@ -220,7 +220,7 @@ =item B<--native> -Normally, B produces bytecode files at most stages of compilation. +Normally, B produces bitcode files at most stages of compilation. With this option, B will arrange for native object files to be generated with the B<-c> option, native assembly files to be generated with the B<-S> option, and native executables to be generated with the Modified: llvm/trunk/docs/CommandGuide/llvmgcc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvmgcc.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvmgcc.pod (original) +++ llvm/trunk/docs/CommandGuide/llvmgcc.pod Mon Jul 9 06:24:05 2007 @@ -12,10 +12,10 @@ The B command is the LLVM C front end. It is a modified version of gcc that compiles C/ObjC programs into native objects, LLVM -bytecode or LLVM assembly language, depending upon the options. +bitcode or LLVM assembly language, depending upon the options. By default, B compiles to native objects just like GCC does. If the -B<-emit-llvm> option is given then it will generate LLVM bytecode files instead. +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 has many @@ -32,14 +32,14 @@ =item B<-S> -Do not generate an LLVM bytecode file. Rather, compile the source +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 bytecode file. This bytecode file can then be -linked with other bytecode files later on to generate a full LLVM +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 @@ -59,11 +59,11 @@ =item B<-l>I Link in the library libI.[bc | a | so]. This library should -be a bytecode library. +be a bitcode library. =item B<-emit-llvm> -Make the output be LLVM bytecode (or assembly) instead of native object (or +Make the output be LLVM bitcode (or assembly) instead of native object (or assembly). =back Modified: llvm/trunk/docs/CommandGuide/llvmgxx.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvmgxx.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvmgxx.pod (original) +++ llvm/trunk/docs/CommandGuide/llvmgxx.pod Mon Jul 9 06:24:05 2007 @@ -12,10 +12,10 @@ The B command is the LLVM C++ front end. It is a modified version of g++ that compiles C++/ObjC++ programs into native code, -LLVM bytecode or assembly language, depending upon the options. +LLVM bitcode or assembly language, depending upon the options. By default, B compiles to native objects just like GCC does. If the -B<-emit-llvm> option is given then it will generate LLVM bytecode files instead. +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 has many @@ -32,14 +32,14 @@ =item B<-S> -Do not generate an LLVM bytecode file. Rather, compile the source +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 bytecode file. This bytecode file can then be -linked with other bytecode files later on to generate a full LLVM +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 @@ -59,11 +59,11 @@ =item B<-l>I Link in the library libI.[bc | a | so]. This library should -be a bytecode library. +be a bitcode library. =item B<-emit-llvm> -Make the output be LLVM bytecode (or assembly) instead of native object (or +Make the output be LLVM bitcode (or assembly) instead of native object (or assembly). =back Modified: llvm/trunk/docs/CommandGuide/opt.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/opt.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/opt.pod (original) +++ llvm/trunk/docs/CommandGuide/opt.pod Mon Jul 9 06:24:05 2007 @@ -11,24 +11,24 @@ =head1 DESCRIPTION The B command is the modular LLVM optimizer and analyzer. It takes LLVM -bytecode as input, runs the specified optimizations or analyses on it, and then -outputs the optimized LLVM bytecode or the analysis results. The function of +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 depends on whether the B<-analyze> option is given. When B<-analyze> is specified, B performs various analyses of LLVM -bytecode. It will usually print the results on standard output, but in a few +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 given, B attempts to produce an optimized -bytecode file. The optimizations available via B depend upon what +bitcode file. The optimizations available via B 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 is omitted from the command line or is I<->, B reads its -input from standard input. The input must be an LLVM bytecode file. +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 writes its output to the standard output. @@ -41,7 +41,7 @@ Force overwrite. Normally, B will refuse to overwrite an output file that already exists. With this option, B will -overwrite the output file and replace it with new bytecode. +overwrite the output file and replace it with new bitcode. =item B<-help> Modified: llvm/trunk/docs/CommandGuide/stkrc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/stkrc.pod?rev=38452&r1=38451&r2=38452&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/stkrc.pod (original) +++ llvm/trunk/docs/CommandGuide/stkrc.pod Mon Jul 9 06:24:05 2007 @@ -14,8 +14,8 @@ simple stack based, Forth-like language that was written as a demonstration language for LLVM. For details on the language, please see L . The B compiler is fairly -minimal. It compiles to bytecode only and doesn't perform any optimizations. -The output of stkrc (a bytecode file) can be piped through other LLVM tools +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 is omitted or is C<->, then B reads its input @@ -65,7 +65,7 @@ =item B<-f> Force the output to be written. Normally, B won't overwrite an existing -bytecode file. This option overrides that behavior. +bitcode file. This option overrides that behavior. =item B<-s> F From ggreif at gmail.com Mon Jul 9 07:00:59 2007 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 09 Jul 2007 12:00:59 -0000 Subject: [llvm-commits] [llvm] r38453 - in /llvm/trunk: include/llvm/CodeGen/SimpleRegisterCoalescing.h lib/CodeGen/SimpleRegisterCoalescing.cpp lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <200707091201.l69C10xP001349@zion.cs.uiuc.edu> Author: ggreif Date: Mon Jul 9 07:00:59 2007 New Revision: 38453 URL: http://llvm.org/viewvc/llvm-project?rev=38453&view=rev Log: fix typos Modified: llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Modified: llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h?rev=38453&r1=38452&r2=38453&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h Mon Jul 9 07:00:59 2007 @@ -86,17 +86,17 @@ /// joinIntervals - join compatible live intervals void joinIntervals(); - /// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting - /// copies that cannot yet be coallesced into the "TryAgain" list. - void CopyCoallesceInMBB(MachineBasicBlock *MBB, + /// CopyCoalesceInMBB - Coallesce copies in the specified MBB, putting + /// copies that cannot yet be coalesced into the "TryAgain" list. + void CopyCoalesceInMBB(MachineBasicBlock *MBB, std::vector *TryAgain, bool PhysOnly = false); /// 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 coallesced away, or if it is never possible - /// to coallesce these this copy, due to register constraints. It returns - /// false if it is not currently possible to coallesce this interval, but - /// it may be possible if other things get coallesced. + /// if the copy was successfully coalesced away, or if it is never possible + /// to coalesce these this copy, due to register constraints. It returns + /// false if it is not currently possible to coalesce this interval, but + /// it may be possible if other things get coalesced. bool JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg, bool PhysOnly = false); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=38453&r1=38452&r2=38453&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Jul 9 07:00:59 2007 @@ -43,7 +43,7 @@ namespace { static cl::opt EnableJoining("join-liveintervals", - cl::desc("Coallesce copies (default=true)"), + cl::desc("Coalesce copies (default=true)"), cl::init(true)); RegisterPass @@ -64,7 +64,7 @@ MachineFunctionPass::getAnalysisUsage(AU); } -/// AdjustCopiesBackFrom - We found a non-trivially-coallescable copy with IntA +/// 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, @@ -171,10 +171,10 @@ /// 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 coallesced away, or if it is never possible -/// to coallesce this copy, due to register constraints. It returns -/// false if it is not currently possible to coallesce this interval, but -/// it may be possible if other things get coallesced. +/// if the copy was successfully coalesced away, or if it is never possible +/// to coalesce this copy, due to register constraints. It returns +/// false if it is not currently possible to coalesce this interval, but +/// it may be possible if other things get coalesced. bool SimpleRegisterCoalescing::JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg, bool PhysOnly) { DOUT << li_->getInstructionIndex(CopyMI) << '\t' << *CopyMI; @@ -185,8 +185,8 @@ // If they are already joined we continue. if (repSrcReg == repDstReg) { - DOUT << "\tCopy already coallesced.\n"; - return true; // Not coallescable. + DOUT << "\tCopy already coalesced.\n"; + return true; // Not coalescable. } bool SrcIsPhys = MRegisterInfo::isPhysicalRegister(repSrcReg); @@ -197,24 +197,24 @@ // If they are both physical registers, we cannot join them. if (SrcIsPhys && DstIsPhys) { - DOUT << "\tCan not coallesce physregs.\n"; - return true; // Not coallescable. + DOUT << "\tCan not coalesce physregs.\n"; + return true; // Not coalescable. } // We only join virtual registers with allocatable physical registers. if (SrcIsPhys && !allocatableRegs_[repSrcReg]) { DOUT << "\tSrc reg is unallocatable physreg.\n"; - return true; // Not coallescable. + return true; // Not coalescable. } if (DstIsPhys && !allocatableRegs_[repDstReg]) { DOUT << "\tDst reg is unallocatable physreg.\n"; - return true; // Not coallescable. + return true; // Not coalescable. } // If they are not of the same register class, we cannot join them. if (differingRegisterClasses(repSrcReg, repDstReg)) { DOUT << "\tSrc/Dest are different register classes.\n"; - return true; // Not coallescable. + return true; // Not coalescable. } LiveInterval &SrcInt = li_->getInterval(repSrcReg); @@ -320,7 +320,7 @@ LiveInInt.removeRange(RemoveStart, RemoveEnd); } } else { - // Coallescing failed. + // Coalescing failed. // If we can eliminate the copy without merging the live ranges, do so now. if (AdjustCopiesBackFrom(SrcInt, DstInt, CopyMI)) @@ -448,7 +448,7 @@ // 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 coallesce. + // cannot coalesce. LiveInterval::iterator LHSIt = LHS.begin(), LHSEnd = LHS.end(); LiveInterval::iterator RHSIt = RHS.begin(), RHSEnd = RHS.end(); @@ -474,7 +474,7 @@ // 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 - // coallesce these live ranges and we bail out. + // 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->ValId, EliminatedLHSVals)) { @@ -497,12 +497,12 @@ // 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 coallesced away) even though + // 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->ValId, EliminatedLHSVals)) { // We already know that this value number is going to be merged in - // if coallescing succeeds. Just skip the liverange. + // 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 @@ -520,7 +520,7 @@ } } - // If we got here, we know that the coallescing will be successful and that + // 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 @@ -569,7 +569,7 @@ /// below to update aliases. bool SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS) { // Compute the final value assignment, assuming that the live ranges can be - // coallesced. + // coalesced. SmallVector LHSValNoAssignments; SmallVector RHSValNoAssignments; SmallVector, 16> ValueNumberInfo; @@ -607,7 +607,7 @@ unsigned RHSSrcReg = RHS.getSrcRegForValNum(0); if ((RHSSrcReg == 0 || rep(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 coallescable. This joiner + // faster checks to see if the live ranges are coalescable. This joiner // can't swap the LHS/RHS intervals though. if (!MRegisterInfo::isPhysicalRegister(RHS.reg)) { return SimpleJoin(LHS, RHS); @@ -631,7 +631,7 @@ if (unsigned LHSSrcReg = LHS.getSrcRegForValNum(VN)) { if (rep(LHSSrcReg) != RHS.reg) { // If this is not a copy from the RHS, its value number will be - // unmodified by the coallescing. + // unmodified by the coalescing. ValueNumberInfo[VN] = LHS.getValNumInfo(VN); LHSValNoAssignments[VN] = VN; } else if (RHSValID == -1) { @@ -723,7 +723,7 @@ } // Armed with the mappings of LHS/RHS values to ultimate values, walk the - // interval lists to see if these intervals are coallescable. + // 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(); @@ -750,7 +750,7 @@ // 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 coallesce them. If not, we can't. + // result liverange, we can still coalesce them. If not, we can't. if (LHSValNoAssignments[I->ValId] != RHSValNoAssignments[J->ValId]) return false; } @@ -764,8 +764,8 @@ } } - // If we get here, we know that we can coallesce the live ranges. Ask the - // intervals to coallesce themselves now. + // 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], ValueNumberInfo); return true; @@ -784,7 +784,7 @@ }; } -void SimpleRegisterCoalescing::CopyCoallesceInMBB(MachineBasicBlock *MBB, +void SimpleRegisterCoalescing::CopyCoalesceInMBB(MachineBasicBlock *MBB, std::vector *TryAgain, bool PhysOnly) { DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n"; @@ -813,7 +813,7 @@ // 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) - CopyCoallesceInMBB(I, &TryAgainList); + CopyCoalesceInMBB(I, &TryAgainList); } else { // Otherwise, join intervals in inner loops before other intervals. // Unfortunately we can't just iterate over loop hierarchy here because @@ -830,9 +830,9 @@ // Finally, join intervals in loop nest order. for (unsigned i = 0, e = MBBs.size(); i != e; ++i) - CopyCoallesceInMBB(MBBs[i].second, NULL, true); + CopyCoalesceInMBB(MBBs[i].second, NULL, true); for (unsigned i = 0, e = MBBs.size(); i != e; ++i) - CopyCoallesceInMBB(MBBs[i].second, &TryAgainList, false); + CopyCoalesceInMBB(MBBs[i].second, &TryAgainList, false); } // Joining intervals can allow other intervals to be joined. Iteratively join @@ -1037,7 +1037,7 @@ r2rMap_.grow(mf_->getSSARegMap()->getLastVirtReg()); - // Join (coallesce) intervals if requested. + // Join (coalesce) intervals if requested. if (EnableJoining) { joinIntervals(); DOUT << "********** INTERVALS POST JOINING **********\n"; Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=38453&r1=38452&r2=38453&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Mon Jul 9 07:00:59 2007 @@ -146,7 +146,7 @@ /// 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, coallesce this block with neighboring blocks. Return the +/// If possible, coalesce this block with neighboring blocks. Return the /// FreeRangeHeader to allocate from. FreeRangeHeader *MemoryRangeHeader::FreeBlock(FreeRangeHeader *FreeList) { MemoryRangeHeader *FollowingBlock = &getBlockAfter(); @@ -159,7 +159,7 @@ if (!FollowingBlock->ThisAllocated) { FreeRangeHeader &FollowingFreeBlock = *(FreeRangeHeader *)FollowingBlock; // "FreeList" always needs to be a valid free block. If we're about to - // coallesce with it, update our notion of what the free list is. + // coalesce with it, update our notion of what the free list is. if (&FollowingFreeBlock == FreeList) { FreeList = FollowingFreeBlock.Next; FreeListToReturn = 0; @@ -171,12 +171,12 @@ BlockSize += FollowingFreeBlock.BlockSize; FollowingBlock = &FollowingFreeBlock.getBlockAfter(); - // Tell the block after the block we are coallescing that this block is + // Tell the block after the block we are coalescing that this block is // allocated. FollowingBlock->PrevAllocated = 1; } - assert(FollowingBlock->ThisAllocated && "Missed coallescing?"); + assert(FollowingBlock->ThisAllocated && "Missed coalescing?"); if (FreeRangeHeader *PrevFreeBlock = getFreeBlockBefore()) { PrevFreeBlock->GrowBlock(PrevFreeBlock->BlockSize + BlockSize); @@ -369,7 +369,7 @@ Mem2->Prev = Mem2; // Mem2 *is* the free list for now. Mem2->Next = Mem2; - /// Add a tiny allocated region so that Mem2 is never coallesced away. + /// Add a tiny allocated region so that Mem2 is never coalesced away. MemoryRangeHeader *Mem1 = (MemoryRangeHeader*)Mem2-1; Mem1->ThisAllocated = 1; Mem1->PrevAllocated = 0; From ggreif at gmail.com Mon Jul 9 07:20:30 2007 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 09 Jul 2007 12:20:30 -0000 Subject: [llvm-commits] [llvm] r38454 - /llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h Message-ID: <200707091220.l69CKUhu001896@zion.cs.uiuc.edu> Author: ggreif Date: Mon Jul 9 07:20:30 2007 New Revision: 38454 URL: http://llvm.org/viewvc/llvm-project?rev=38454&view=rev Log: missed this one Modified: llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h Modified: llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h?rev=38454&r1=38453&r2=38454&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/include/llvm/CodeGen/SimpleRegisterCoalescing.h Mon Jul 9 07:20:30 2007 @@ -86,7 +86,7 @@ /// joinIntervals - join compatible live intervals void joinIntervals(); - /// CopyCoalesceInMBB - Coallesce copies in the specified MBB, putting + /// CopyCoalesceInMBB - Coalesce copies in the specified MBB, putting /// copies that cannot yet be coalesced into the "TryAgain" list. void CopyCoalesceInMBB(MachineBasicBlock *MBB, std::vector *TryAgain, bool PhysOnly = false); From djg at cray.com Mon Jul 9 08:42:32 2007 From: djg at cray.com (Dan Gohman) Date: Mon, 09 Jul 2007 13:42:32 -0000 Subject: [llvm-commits] [llvm] r38455 - in /llvm/trunk/test/CodeGen/ARM: ifcvt6.ll ifcvt7.ll ifcvt8.ll Message-ID: <200707091342.l69DgWeE004320@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 9 08:42:32 2007 New Revision: 38455 URL: http://llvm.org/viewvc/llvm-project?rev=38455&view=rev Log: Add explicit triples to these tests so that llc behaves as expected on non-Apple hosts. Modified: llvm/trunk/test/CodeGen/ARM/ifcvt6.ll llvm/trunk/test/CodeGen/ARM/ifcvt7.ll llvm/trunk/test/CodeGen/ARM/ifcvt8.ll Modified: llvm/trunk/test/CodeGen/ARM/ifcvt6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt6.ll?rev=38455&r1=38454&r2=38455&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/ifcvt6.ll (original) +++ llvm/trunk/test/CodeGen/ARM/ifcvt6.ll Mon Jul 9 08:42:32 2007 @@ -1,6 +1,11 @@ -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep cmpne | wc -l | grep 1 -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep ldmhi | wc -l | grep 1 +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \ +; RUN: grep cmpne | wc -l | grep 1 +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \ +; RUN: grep ldmhi | wc -l | grep 1 define void @foo(i32 %X, i32 %Y) { entry: Modified: llvm/trunk/test/CodeGen/ARM/ifcvt7.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt7.ll?rev=38455&r1=38454&r2=38455&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/ifcvt7.ll (original) +++ llvm/trunk/test/CodeGen/ARM/ifcvt7.ll Mon Jul 9 08:42:32 2007 @@ -1,7 +1,14 @@ -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep cmpeq | wc -l | grep 1 -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep moveq | wc -l | grep 1 -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep ldmeq | wc -l | grep 1 +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \ +; RUN: grep cmpeq | wc -l | grep 1 +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \ +; RUN: grep moveq | wc -l | grep 1 +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \ +; RUN: grep ldmeq | wc -l | grep 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* } Modified: llvm/trunk/test/CodeGen/ARM/ifcvt8.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt8.ll?rev=38455&r1=38454&r2=38455&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/ifcvt8.ll (original) +++ llvm/trunk/test/CodeGen/ARM/ifcvt8.ll Mon Jul 9 08:42:32 2007 @@ -1,5 +1,8 @@ -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion -; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep ldmne | wc -l | grep 1 +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion +; RUN: llvm-as < %s | \ +; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \ +; RUN: grep ldmne | wc -l | grep 1 %struct.SString = type { i8*, i32, i32 } From djg at cray.com Mon Jul 9 10:15:24 2007 From: djg at cray.com (Dan Gohman) Date: Mon, 09 Jul 2007 15:15:24 -0000 Subject: [llvm-commits] [llvm] r38456 - /llvm/trunk/include/llvm/Target/TargetInstrInfo.h Message-ID: <200707091515.l69FFOqm007505@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 9 10:15:24 2007 New Revision: 38456 URL: http://llvm.org/viewvc/llvm-project?rev=38456&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=38456&r1=38455&r2=38456&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Jul 9 10:15:24 2007 @@ -329,7 +329,7 @@ /// 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 moretrue + /// 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. From djg at cray.com Mon Jul 9 10:25:18 2007 From: djg at cray.com (Dan Gohman) Date: Mon, 09 Jul 2007 15:25:18 -0000 Subject: [llvm-commits] [llvm] r38457 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolutionExpressions.h lib/Analysis/ScalarEvolution.cpp Message-ID: <200707091525.l69FPIg0007822@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 9 10:25:17 2007 New Revision: 38457 URL: http://llvm.org/viewvc/llvm-project?rev=38457&view=rev Log: Move the APInt form of SCEVUnknown::getIntegerSCEV to SCEVConstant::get, and use SCEVConstant::get instead of SCEVUnknown::get when constructing a SCEV for a ConstantInt. Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=38457&r1=38456&r2=38457&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Mon Jul 9 10:25:17 2007 @@ -33,13 +33,14 @@ /// class SCEVConstant : public SCEV { ConstantInt *V; - SCEVConstant(ConstantInt *v) : SCEV(scConstant), V(v) {} + explicit SCEVConstant(ConstantInt *v) : SCEV(scConstant), V(v) {} virtual ~SCEVConstant(); public: /// get method - This just gets and returns a new SCEVConstant object. /// static SCEVHandle get(ConstantInt *V); + static SCEVHandle get(const APInt& Val); ConstantInt *getValue() const { return V; } @@ -511,7 +512,6 @@ /// getIntegerSCEV - Given an integer or FP type, create a constant for the /// specified signed integer value and return a SCEV for the constant. static SCEVHandle getIntegerSCEV(int Val, const Type *Ty); - static SCEVHandle getIntegerSCEV(const APInt& Val); Value *getValue() const { return V; } Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=38457&r1=38456&r2=38457&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jul 9 10:25:17 2007 @@ -183,6 +183,10 @@ return R; } +SCEVHandle SCEVConstant::get(const APInt& Val) { + return get(ConstantInt::get(Val)); +} + ConstantRange SCEVConstant::getValueRange() const { return ConstantRange(V->getValue()); } @@ -487,10 +491,6 @@ return SCEVUnknown::get(C); } -SCEVHandle SCEVUnknown::getIntegerSCEV(const APInt& Val) { - return SCEVUnknown::get(ConstantInt::get(Val)); -} - /// 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. @@ -531,7 +531,7 @@ APInt Result(Val.getBitWidth(), 1); for (; NumSteps; --NumSteps) Result *= Val-(NumSteps-1); - return SCEVUnknown::get(ConstantInt::get(Result)); + return SCEVConstant::get(Result); } const Type *Ty = V->getType(); @@ -1716,8 +1716,8 @@ } static ConstantInt * -EvaluateConstantChrecAtConstant(const SCEVAddRecExpr *AddRec, Constant *C) { - SCEVHandle InVal = SCEVConstant::get(cast(C)); +EvaluateConstantChrecAtConstant(const SCEVAddRecExpr *AddRec, ConstantInt *C) { + SCEVHandle InVal = SCEVConstant::get(C); SCEVHandle Val = AddRec->evaluateAtIteration(InVal); assert(isa(Val) && "Evaluation of SCEV at constant didn't fold correctly?"); @@ -2199,8 +2199,8 @@ ConstantInt *Solution1 = ConstantInt::get((NegB + SqrtVal).sdiv(TwoA)); ConstantInt *Solution2 = ConstantInt::get((NegB - SqrtVal).sdiv(TwoA)); - return std::make_pair(SCEVUnknown::get(Solution1), - SCEVUnknown::get(Solution2)); + return std::make_pair(SCEVConstant::get(Solution1), + SCEVConstant::get(Solution2)); } // end APIntOps namespace } @@ -2468,15 +2468,14 @@ EvaluateConstantChrecAtConstant(this, ConstantInt::get(ExitVal - One))->getValue()) && "Linear scev computation is off in a bad way!"); - return SCEVConstant::get(cast(ExitValue)); + return SCEVConstant::get(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 NewOps(op_begin(), op_end()); - NewOps[0] = SCEV::getNegativeSCEV(SCEVUnknown::get( - ConstantInt::get(Range.getUpper()))); + NewOps[0] = SCEV::getNegativeSCEV(SCEVConstant::get(Range.getUpper())); SCEVHandle NewAddRec = SCEVAddRecExpr::get(NewOps, getLoop()); // Next, solve the constructed addrec @@ -2499,17 +2498,17 @@ R1->getValue()); if (Range.contains(R1Val->getValue())) { // The next iteration must be out of the range... - Constant *NextVal = ConstantInt::get(R1->getValue()->getValue()+1); + ConstantInt *NextVal = ConstantInt::get(R1->getValue()->getValue()+1); R1Val = EvaluateConstantChrecAtConstant(this, NextVal); if (!Range.contains(R1Val->getValue())) - return SCEVUnknown::get(NextVal); + return SCEVConstant::get(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. - Constant *NextVal = ConstantInt::get(R1->getValue()->getValue()-1); + ConstantInt *NextVal = ConstantInt::get(R1->getValue()->getValue()-1); R1Val = EvaluateConstantChrecAtConstant(this, NextVal); if (Range.contains(R1Val->getValue())) return R1; From espindola at google.com Mon Jul 9 10:37:25 2007 From: espindola at google.com (Rafael Espindola) Date: Mon, 9 Jul 2007 16:37:25 +0100 Subject: [llvm-commits] [llvm] r37940 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h include/llvm/ParameterAttributes.h lib/AsmParser/Lexer.l lib/AsmParser/llvmAsmParser.y lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/TargetCallingC Message-ID: <38a0d8450707090837x2ba344b8m78de799c5a67d4a7@mail.gmail.com> Sorry for the delay... > first let me point out that much of what you say also applies to > StructReturn, which probably can also be used for returning arrays, > ints etc. And like StructReturn this is all about the ABI: my > understanding is that on some platforms the ABI allows for passing > (small) structs by value. We need to be able to support this, but > how? The idea is to treat such parameters as passed by reference, > and add an attribute to tell the code generators to in fact pass them > in whatever way the ABI says they should be. See PR1521. > > Thus in the IR the function is declared to take a pointer to the > struct as an argument, and the ByVal marker is placed for the > benefit of the code generators. However it is not clear to me > that this is semantically correct. Doesn't ByVal mean what it > says: a copy of the struct is made, and if this copy is modified > inside the called function then this does not change the original > struct? But if in the IR we pass in a pointer to the struct, then > any writes to the struct will modify the original, which is wrong. The way it should work on the code generators is that when compiling a call to a function with a "byval" argument, a copy of the struct is created and placed on the stack. When compiling the function itself, the code generator should use the stack pointer to create a pointer to the *copy* of the structure that was placed on the stack. > Also, I agree that there needs to be more clarity about what is > allowed to be passed ByVal and returned by SRet. I propose that we change the verifier so that it checks that "byval" is only applied to arguments that are pointers to structures. When we find a case were an array should be passed by value, we can easily change the verifier. I will try to write a patch (with a testcase) tomorrow. > Finally, if StructReturn can also return arrays, then I don't mind > to much if ByVal is called StructByVal or something like that. > > Ciao, > > Duncan. Cheers, Rafael From djg at cray.com Mon Jul 9 10:48:14 2007 From: djg at cray.com (Dan Gohman) Date: Mon, 9 Jul 2007 10:48:14 -0500 Subject: [llvm-commits] [llvm] r37843 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp In-Reply-To: <239AACE9-F6F0-4C93-AF6B-CEF2125D030F@apple.com> References: <20070705144923.GK5693@village.us.cray.com> <8C8471C2-C2F2-4F05-9448-C8BE48737B1C@apple.com> <16e5fdf90707051633n37bdb9bdu2ef96002be91317d@mail.gmail.com> <2E082165-6BB1-465A-AE4B-ED696ED37CFC@apple.com> <15F625BF-09FB-4C24-9EF9-004C2643F370@apple.com> <20070706131057.GO5693@village.us.cray.com> <239AACE9-F6F0-4C93-AF6B-CEF2125D030F@apple.com> Message-ID: <20070709154814.GY5693@village.us.cray.com> I found a problem in an interaction between my patch and the PPCISelLowering.cpp code for lowering call results. The PPC target code effectively assigns registers for a call result in reverse order. My patch was presenting it with registers already in target order. This is more consistent with code for other constructs, so it seems best to fix the PPCISelLowering.cpp code. Attached is a new patch. It's the same change to SelectionDAGISel.cpp as before, but it's now accompanied by the PPCISelLowering.cpp update and a test case which demonstrates the failure with the previous patch and passes with the new one. Thanks for your help, Dan On Fri, Jul 06, 2007 at 01:40:33PM -0700, Evan Cheng wrote: > This seems to have fixed llvm-test failures, but Mac OS X PPC > bootstrapping is still unhappy. :-( > > Evan > -- Dan Gohman, Cray Inc. -------------- next part -------------- Index: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (revision 38457) +++ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (working copy) @@ -621,7 +621,6 @@ unsigned NumParts, MVT::ValueType PartVT, MVT::ValueType ValueVT, - bool EndianOrder, ISD::NodeType AssertOp = ISD::DELETED_NODE) { if (!MVT::isVector(ValueVT) || NumParts == 1) { SDOperand Val = Parts[0]; @@ -631,7 +630,7 @@ assert(NumParts == 2 && "Cannot expand to more than 2 elts yet!"); SDOperand Hi = Parts[1]; - if (EndianOrder && !DAG.getTargetLoweringInfo().isLittleEndian()) + if (!DAG.getTargetLoweringInfo().isLittleEndian()) std::swap(Val, Hi); return DAG.getNode(ISD::BUILD_PAIR, ValueVT, Val, Hi); } @@ -692,7 +691,7 @@ // as appropriate. for (unsigned i = 0; i != NumParts; ++i) Ops[i] = getCopyFromParts(DAG, &Parts[i], 1, - PartVT, IntermediateVT, EndianOrder); + PartVT, IntermediateVT); } else if (NumParts > 0) { // If the intermediate type was expanded, build the intermediate operands // from the parts. @@ -701,7 +700,7 @@ unsigned Factor = NumIntermediates / NumParts; for (unsigned i = 0; i != NumIntermediates; ++i) Ops[i] = getCopyFromParts(DAG, &Parts[i * Factor], Factor, - PartVT, IntermediateVT, EndianOrder); + PartVT, IntermediateVT); } // Build a vector with BUILD_VECTOR or CONCAT_VECTORS from the intermediate @@ -718,8 +717,7 @@ SDOperand Val, SDOperand *Parts, unsigned NumParts, - MVT::ValueType PartVT, - bool EndianOrder) { + MVT::ValueType PartVT) { MVT::ValueType ValueVT = Val.getValueType(); if (!MVT::isVector(ValueVT) || NumParts == 1) { @@ -728,7 +726,7 @@ for (unsigned i = 0; i != NumParts; ++i) Parts[i] = DAG.getNode(ISD::EXTRACT_ELEMENT, PartVT, Val, DAG.getConstant(i, MVT::i32)); - if (EndianOrder && !DAG.getTargetLoweringInfo().isLittleEndian()) + if (!DAG.getTargetLoweringInfo().isLittleEndian()) std::reverse(Parts, Parts + NumParts); return; } @@ -789,7 +787,7 @@ // 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, EndianOrder); + 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. @@ -797,7 +795,7 @@ "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, EndianOrder); + getCopyToParts(DAG, Ops[i], &Parts[i * Factor], Factor, PartVT); } } @@ -928,7 +926,7 @@ unsigned NumParts = TLI.getNumRegisters(VT); MVT::ValueType PartVT = TLI.getRegisterType(VT); SmallVector Parts(NumParts); - getCopyToParts(DAG, RetOp, &Parts[0], NumParts, PartVT, true); + getCopyToParts(DAG, RetOp, &Parts[0], NumParts, PartVT); for (unsigned i = 0; i < NumParts; ++i) { NewValues.push_back(Parts[i]); NewValues.push_back(DAG.getConstant(false, MVT::i32)); @@ -2952,11 +2950,6 @@ /// If the Flag pointer is NULL, no flag is used. SDOperand RegsForValue::getCopyFromRegs(SelectionDAG &DAG, SDOperand &Chain, SDOperand *Flag)const{ - // Get the list of registers, in the appropriate order. - std::vector R(Regs); - if (!DAG.getTargetLoweringInfo().isLittleEndian()) - std::reverse(R.begin(), R.end()); - // Copy the legal parts from the registers. unsigned NumParts = Regs.size(); SmallVector Parts(NumParts); @@ -2971,7 +2964,7 @@ } // Assemble the legal parts into the final value. - return getCopyFromParts(DAG, &Parts[0], NumParts, RegVT, ValueVT, false); + return getCopyFromParts(DAG, &Parts[0], NumParts, RegVT, ValueVT); } /// getCopyToRegs - Emit a series of CopyToReg nodes that copies the @@ -2980,21 +2973,16 @@ /// 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 registers, in the appropriate order. - std::vector R(Regs); - if (!DAG.getTargetLoweringInfo().isLittleEndian()) - std::reverse(R.begin(), R.end()); - // Get the list of the values's legal parts. unsigned NumParts = Regs.size(); SmallVector Parts(NumParts); - getCopyToParts(DAG, Val, &Parts[0], NumParts, RegVT, false); + getCopyToParts(DAG, Val, &Parts[0], NumParts, RegVT); // Copy the parts into the registers. for (unsigned i = 0; i != NumParts; ++i) { SDOperand Part = Flag ? - DAG.getCopyToReg(Chain, R[i], Parts[i], *Flag) : - DAG.getCopyToReg(Chain, R[i], Parts[i]); + DAG.getCopyToReg(Chain, Regs[i], Parts[i], *Flag) : + DAG.getCopyToReg(Chain, Regs[i], Parts[i]); Chain = Part.getValue(0); if (Flag) *Flag = Part.getValue(1); @@ -3867,7 +3855,7 @@ SmallVector Parts(NumParts); for (unsigned j = 0; j != NumParts; ++j) Parts[j] = SDOperand(Result, i++); - Ops.push_back(getCopyFromParts(DAG, &Parts[0], NumParts, PartVT, VT, true)); + Ops.push_back(getCopyFromParts(DAG, &Parts[0], NumParts, PartVT, VT)); break; } } @@ -3939,7 +3927,7 @@ MVT::ValueType PartVT = getRegisterType(VT); unsigned NumParts = getNumRegisters(VT); SmallVector Parts(NumParts); - getCopyToParts(DAG, Op, &Parts[0], NumParts, PartVT, true); + getCopyToParts(DAG, Op, &Parts[0], NumParts, PartVT); for (unsigned i = 0; i != NumParts; ++i) { // if it isn't first piece, alignment must be 1 unsigned MyFlags = Flags; @@ -3979,7 +3967,7 @@ SmallVector Results(NumRegs); for (unsigned i = 0; i != NumRegs; ++i) Results[i] = Res.getValue(i); - Res = getCopyFromParts(DAG, &Results[0], NumRegs, RegisterVT, VT, false, AssertOp); + Res = getCopyFromParts(DAG, &Results[0], NumRegs, RegisterVT, VT, AssertOp); } return std::make_pair(Res, Chain); @@ -4269,7 +4257,7 @@ SmallVector Chains(NumRegs); // Copy the value by legal parts into sequential virtual registers. - getCopyToParts(DAG, Op, &Regs[0], NumRegs, RegisterVT, false); + getCopyToParts(DAG, Op, &Regs[0], NumRegs, RegisterVT); for (unsigned i = 0; i != NumRegs; ++i) Chains[i] = DAG.getCopyToReg(getRoot(), Reg + i, Regs[i]); return DAG.getNode(ISD::TokenFactor, MVT::Other, &Chains[0], NumRegs); @@ -4406,8 +4394,8 @@ if (TI->getNumSuccessors()) SuccsHandled.resize(BB->getParent()->getNumBlockIDs()); - // Check successor nodes PHI nodes that expect a constant to be available from - // this block. + // 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(SuccBB->begin())) continue; Index: lib/Target/PowerPC/PPCISelLowering.cpp =================================================================== --- lib/Target/PowerPC/PPCISelLowering.cpp (revision 38457) +++ lib/Target/PowerPC/PPCISelLowering.cpp (working copy) @@ -1774,9 +1774,9 @@ case MVT::Other: break; case MVT::i32: if (Op.Val->getValueType(1) == MVT::i32) { - Chain = DAG.getCopyFromReg(Chain, PPC::R4, MVT::i32, InFlag).getValue(1); + Chain = DAG.getCopyFromReg(Chain, PPC::R3, MVT::i32, InFlag).getValue(1); ResultVals[0] = Chain.getValue(0); - Chain = DAG.getCopyFromReg(Chain, PPC::R3, MVT::i32, + Chain = DAG.getCopyFromReg(Chain, PPC::R4, MVT::i32, Chain.getValue(2)).getValue(1); ResultVals[1] = Chain.getValue(0); NumResults = 2; Index: test/CodeGen/PowerPC/big-endian-call-result.ll =================================================================== --- test/CodeGen/PowerPC/big-endian-call-result.ll (revision 0) +++ test/CodeGen/PowerPC/big-endian-call-result.ll (revision 0) @@ -0,0 +1,13 @@ +; 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 +} From baldrick at free.fr Mon Jul 9 10:52:50 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 9 Jul 2007 17:52:50 +0200 Subject: [llvm-commits] [llvm] r37940 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h include/llvm/ParameterAttributes.h lib/AsmParser/Lexer.l lib/AsmParser/llvmAsmParser.y lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/TargetCallingC In-Reply-To: <38a0d8450707090837x2ba344b8m78de799c5a67d4a7@mail.gmail.com> References: <38a0d8450707090837x2ba344b8m78de799c5a67d4a7@mail.gmail.com> Message-ID: <200707091752.50522.baldrick@free.fr> Hi Rafael, > > Thus in the IR the function is declared to take a pointer to the > > struct as an argument, and the ByVal marker is placed for the > > benefit of the code generators. However it is not clear to me > > that this is semantically correct. Doesn't ByVal mean what it > > says: a copy of the struct is made, and if this copy is modified > > inside the called function then this does not change the original > > struct? But if in the IR we pass in a pointer to the struct, then > > any writes to the struct will modify the original, which is wrong. > > The way it should work on the code generators is that when compiling a > call to a function with a "byval" argument, a copy of the struct is > created and placed on the stack. When compiling the function itself, > the code generator should use the stack pointer to create a pointer to > the *copy* of the structure that was placed on the stack. exactly, and thus alias analysis, inlining etc are all being mislead, because they will think you are modifying the original. This is very dual to StructReturn by the way: if you assign to the sret parameter before calling the routine, and try to read those values inside the routine, you get junk. Likewise here, if you write to the ByVal parameter inside the routine, then try to read those values outside the routine you get junk. This should be at least well documented. Ciao, Duncan. From sabre at nondot.org Mon Jul 9 11:16:34 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 09 Jul 2007 16:16:34 -0000 Subject: [llvm-commits] [llvm] r38458 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200707091616.l69GGZRM010049@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 9 11:16:34 2007 New Revision: 38458 URL: http://llvm.org/viewvc/llvm-project?rev=38458&view=rev Log: Fix this warning: DAGCombiner.cpp: In member function 'llvm::SDOperand::DAGCombiner::visitOR(llvm::SDNode*)': DAGCombiner.cpp:1608: warning: passing negative value '-0x00000000000000001' for argument 1 to 'llvm::SDOperand llvm::SelectionDAG::getConstant(uint64_t, llvm::MVT::ValueType, bool)' oiy. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=38458&r1=38457&r2=38458&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Jul 9 11:16:34 2007 @@ -1605,7 +1605,7 @@ // fold (or x, undef) -> -1 if (N1.getOpcode() == ISD::UNDEF) - return DAG.getConstant(-1, VT); + return DAG.getConstant(~0ULL, VT); // fold (or c1, c2) -> c1|c2 if (N0C && N1C) return DAG.getNode(ISD::OR, VT, N0, N1); From espindola at google.com Mon Jul 9 11:21:50 2007 From: espindola at google.com (Rafael Espindola) Date: Mon, 9 Jul 2007 17:21:50 +0100 Subject: [llvm-commits] [llvm] r37940 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h include/llvm/ParameterAttributes.h lib/AsmParser/Lexer.l lib/AsmParser/llvmAsmParser.y lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/TargetCallingC In-Reply-To: <200707091752.50522.baldrick@free.fr> References: <38a0d8450707090837x2ba344b8m78de799c5a67d4a7@mail.gmail.com> <200707091752.50522.baldrick@free.fr> Message-ID: <38a0d8450707090921k6e5684f4mf22c7a9d22626482@mail.gmail.com> > exactly, and thus alias analysis, inlining etc are all being mislead, > because they will think you are modifying the original. This is very > dual to StructReturn by the way: if you assign to the sret parameter > before calling the routine, and try to read those values inside the > routine, you get junk. Likewise here, if you write to the ByVal parameter > inside the routine, then try to read those values outside the routine you > get junk. This should be at least well documented. Yes, it is nice can of worms :-( For the alias analysis, we would be assuming two pointer might alias when they do not. Might generate worst code, but not incorrect code. The inliner will have to be modified to create a copy of the structure when inlining functions with byval arguments. The only clean solution I can think of is making the stack manipulation explicit in the IL. If I recall correctly, SMLNJ does something similar. With this approach, in order to pass something on the stack (be it a structure or not), one would explicitly allocate the stack frame and pass the stack pointer as explicit argument. I like this approach very much, but it is a hell lot more work. I will update the bug to note that the we have to change the inliner and should change the alias analysis. Does someone knows another module that has to be changed? > > Ciao, > > Duncan. > Cheers, -- Rafael Avila de Espindola Google Ireland Ltd. Gordon House Barrow Street Dublin 4 Ireland Registered in Dublin, Ireland Registration Number: 368047 From resistor at mac.com Mon Jul 9 11:43:55 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 16:43:55 -0000 Subject: [llvm-commits] [llvm] r38459 - /llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Message-ID: <200707091643.l69GhtRY011147@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 11:43:55 2007 New Revision: 38459 URL: http://llvm.org/viewvc/llvm-project?rev=38459&view=rev Log: Fix a comment. Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=38459&r1=38458&r2=38459&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Jul 9 11:43:55 2007 @@ -547,7 +547,7 @@ } //===----------------------------------------------------------------------===// -// ValueTable Class +// ValueNumberedSet Class //===----------------------------------------------------------------------===// class ValueNumberedSet { From sabre at nondot.org Mon Jul 9 11:54:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 09 Jul 2007 16:54:04 -0000 Subject: [llvm-commits] [llvm] r38460 - in /llvm/trunk: include/llvm/ADT/SmallPtrSet.h lib/Support/SmallPtrSet.cpp Message-ID: <200707091654.l69Gs4LG011661@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 9 11:54:03 2007 New Revision: 38460 URL: http://llvm.org/viewvc/llvm-project?rev=38460&view=rev Log: implement operator= for smallptrset Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h llvm/trunk/lib/Support/SmallPtrSet.cpp Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallPtrSet.h?rev=38460&r1=38459&r2=38460&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallPtrSet.h (original) +++ llvm/trunk/include/llvm/ADT/SmallPtrSet.h Mon Jul 9 11:54:03 2007 @@ -127,6 +127,10 @@ /// 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 @@ -233,6 +237,16 @@ 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. + template + const SmallPtrSet + operator=(const SmallPtrSet &RHS) { + CopyFrom(RHS); + return *this; + } + }; } Modified: llvm/trunk/lib/Support/SmallPtrSet.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SmallPtrSet.cpp?rev=38460&r1=38459&r2=38460&view=diff ============================================================================== --- llvm/trunk/lib/Support/SmallPtrSet.cpp (original) +++ llvm/trunk/lib/Support/SmallPtrSet.cpp Mon Jul 9 11:54:03 2007 @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/SmallPtrSet.h" +#include "llvm/Support/MathExtras.h" using namespace llvm; bool SmallPtrSetImpl::insert(void *Ptr) { @@ -172,3 +173,38 @@ } } } + +/// 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) { + // Allocate space if needed or clear the current elements out of the array. + if (CurArraySize < RHS.size()*2) { + if (!isSmall()) + delete [] CurArray; + + // Get a power of two larger than twice the RHS size. + CurArraySize = 1 << Log2_32(RHS.size()*4); + + // Install the new array. Clear all the buckets to empty. + CurArray = new void*[CurArraySize+1]; + memset(CurArray, -1, CurArraySize*sizeof(void*)); + + // The end pointer, always valid, is set to a valid element to help the + // iterator. + CurArray[CurArraySize] = 0; + + } else if (!empty()) { + clear(); + } + + // Now that we know we have enough space, and that the current array is empty, + // copy over all the elements from the RHS. + + for (void **BucketPtr = RHS.CurArray, **E = RHS.CurArray+RHS.CurArraySize; + BucketPtr != E; ++BucketPtr) { + // Copy over the element if it is valid. + void *Elt = *BucketPtr; + if (Elt != getTombstoneMarker() && Elt != getEmptyMarker()) + *const_cast(FindBucketFor(Elt)) = Elt; + } +} From sabre at nondot.org Mon Jul 9 12:11:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 09 Jul 2007 17:11:54 -0000 Subject: [llvm-commits] [llvm] r38461 - /llvm/trunk/include/llvm/ADT/SmallPtrSet.h Message-ID: <200707091711.l69HBsZp012491@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 9 12:11:53 2007 New Revision: 38461 URL: http://llvm.org/viewvc/llvm-project?rev=38461&view=rev Log: work around an aparent gcc name resolution bug by detemplatizing this. Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallPtrSet.h?rev=38461&r1=38460&r2=38461&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallPtrSet.h (original) +++ llvm/trunk/include/llvm/ADT/SmallPtrSet.h Mon Jul 9 12:11:53 2007 @@ -240,9 +240,8 @@ // Allow assignment from any smallptrset with the same element type even if it // doesn't have the same smallsize. - template const SmallPtrSet - operator=(const SmallPtrSet &RHS) { + operator=(const SmallPtrSet &RHS) { CopyFrom(RHS); return *this; } From sabre at nondot.org Mon Jul 9 12:14:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 09 Jul 2007 17:14:58 -0000 Subject: [llvm-commits] [llvm] r38462 - /llvm/trunk/test/CodeGen/PowerPC/compare-duplicate.ll Message-ID: <200707091714.l69HEw1w012716@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 9 12:14:58 2007 New Revision: 38462 URL: http://llvm.org/viewvc/llvm-project?rev=38462&view=rev Log: add target triple to fix PR1546 Modified: llvm/trunk/test/CodeGen/PowerPC/compare-duplicate.ll Modified: llvm/trunk/test/CodeGen/PowerPC/compare-duplicate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/compare-duplicate.ll?rev=38462&r1=38461&r2=38462&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/compare-duplicate.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/compare-duplicate.ll Mon Jul 9 12:14:58 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc | not grep slwi +; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin8 | not grep slwi define i32 @test(i32 %A, i32 %B) { %C = sub i32 %B, %A From sabre at nondot.org Mon Jul 9 12:25:30 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 09 Jul 2007 17:25:30 -0000 Subject: [llvm-commits] [llvm] r38463 - in /llvm/trunk/lib/Target: ARM/ARMTargetMachine.cpp Alpha/AlphaTargetMachine.cpp IA64/IA64TargetMachine.cpp Mips/MipsTargetMachine.cpp PowerPC/PPCTargetMachine.cpp Sparc/SparcTargetMachine.cpp X86/X86TargetMachine.cpp Message-ID: <200707091725.l69HPUZM013566@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 9 12:25:29 2007 New Revision: 38463 URL: http://llvm.org/viewvc/llvm-project?rev=38463&view=rev Log: The various "getModuleMatchQuality" implementations should return zero if they see a target triple they don't understand. Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=38463&r1=38462&r2=38463&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Mon Jul 9 12:25:29 2007 @@ -48,6 +48,9 @@ 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 @@ -94,6 +97,8 @@ std::string TT = M.getTargetTriple(); if (TT.size() >= 4 && std::string(TT.begin(), TT.begin()+4) == "arm-") 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) Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp?rev=38463&r1=38462&r2=38463&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp Mon Jul 9 12:25:29 2007 @@ -35,6 +35,8 @@ 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) Modified: llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp?rev=38463&r1=38462&r2=38463&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp Mon Jul 9 12:25:29 2007 @@ -50,6 +50,8 @@ 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; Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=38463&r1=38462&r2=38463&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Mon Jul 9 12:25:29 2007 @@ -40,13 +40,14 @@ // return 0 and must specify -march to gen MIPS code. unsigned MipsTargetMachine:: -getModuleMatchQuality(const Module &M) -{ +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; - + // If the target triple is something non-mips, we don't match. + if (!TT.empty()) return 0; + return 0; } Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=38463&r1=38462&r2=38463&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Mon Jul 9 12:25:29 2007 @@ -55,6 +55,9 @@ 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 Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp?rev=38463&r1=38462&r2=38463&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Mon Jul 9 12:25:29 2007 @@ -39,6 +39,9 @@ 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) Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=38463&r1=38462&r2=38463&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Mon Jul 9 12:25:29 2007 @@ -62,6 +62,8 @@ 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) @@ -85,6 +87,9 @@ 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 From sabre at nondot.org Mon Jul 9 12:31:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 09 Jul 2007 17:31:07 -0000 Subject: [llvm-commits] [llvm] r38464 - /llvm/trunk/test/CodeGen/Generic/vector.ll Message-ID: <200707091731.l69HV7S9014008@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 9 12:31:07 2007 New Revision: 38464 URL: http://llvm.org/viewvc/llvm-project?rev=38464&view=rev Log: remove this bogus t-t Modified: llvm/trunk/test/CodeGen/Generic/vector.ll Modified: llvm/trunk/test/CodeGen/Generic/vector.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/vector.ll?rev=38464&r1=38463&r2=38464&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/vector.ll (original) +++ llvm/trunk/test/CodeGen/Generic/vector.ll Mon Jul 9 12:31:07 2007 @@ -1,6 +1,5 @@ ; Test that vectors are scalarized/lowered correctly. ; RUN: llvm-upgrade < %s | llvm-as | llc -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple a-b-c %f1 = type <1 x float> %f2 = type <2 x float> From sabre at nondot.org Mon Jul 9 12:32:28 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 09 Jul 2007 17:32:28 -0000 Subject: [llvm-commits] [llvm] r38465 - /llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll Message-ID: <200707091732.l69HWSbZ014088@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 9 12:32:28 2007 New Revision: 38465 URL: http://llvm.org/viewvc/llvm-project?rev=38465&view=rev Log: allow this to work on ppc-darwin Modified: llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll Modified: llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll?rev=38465&r1=38464&r2=38465&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll (original) +++ llvm/trunk/test/CodeGen/X86/illegal-vector-args-return.ll Mon Jul 9 12:32:28 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | llc -mattr=+sse2 | grep {mulpd %xmm3, %xmm1} -; RUN: llvm-as < %s | llc -mattr=+sse2 | grep {mulpd %xmm2, %xmm0} -; RUN: llvm-as < %s | llc -mattr=+sse2 | grep {addps %xmm3, %xmm1} -; RUN: llvm-as < %s | llc -mattr=+sse2 | grep {addps %xmm2, %xmm0} +; 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 From sabre at nondot.org Mon Jul 9 12:35:18 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 09 Jul 2007 17:35:18 -0000 Subject: [llvm-commits] [llvm] r38466 - /llvm/trunk/test/CodeGen/X86/fp_constant_op.llx Message-ID: <200707091735.l69HZIHI014283@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 9 12:35:18 2007 New Revision: 38466 URL: http://llvm.org/viewvc/llvm-project?rev=38466&view=rev Log: force a cpu without SSE Modified: llvm/trunk/test/CodeGen/X86/fp_constant_op.llx Modified: llvm/trunk/test/CodeGen/X86/fp_constant_op.llx URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fp_constant_op.llx?rev=38466&r1=38465&r2=38466&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fp_constant_op.llx (original) +++ llvm/trunk/test/CodeGen/X86/fp_constant_op.llx Mon Jul 9 12:35:18 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \ +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel -mcpu=i486 | \ ; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul} ; Test that the load of the constant is folded into the operation. From clattner at apple.com Mon Jul 9 12:40:58 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Jul 2007 10:40:58 -0700 Subject: [llvm-commits] [llvm] r38435 - /llvm/trunk/docs/index.html In-Reply-To: <200707090631.l696Vpu1020332@zion.cs.uiuc.edu> References: <200707090631.l696Vpu1020332@zion.cs.uiuc.edu> Message-ID: <38ECA269-FE68-4887-843F-856EBFA968C2@apple.com> On Jul 8, 2007, at 11:31 PM, Reid Spencer wrote: > Author: reid > Date: Mon Jul 9 01:31:51 2007 > New Revision: 38435 > > URL: http://llvm.org/viewvc/llvm-project?rev=38435&view=rev > Log: > Links for commands are now generated into /cmds/ URL. Nice! -Chris From clattner at apple.com Mon Jul 9 12:56:42 2007 From: clattner at apple.com (clattner at apple.com) Date: Mon, 9 Jul 2007 10:56:42 -0700 (PDT) Subject: [llvm-commits] [129252] Enable llvm-gcc to build when LLVM is configured with --enable-expensive-checks . Message-ID: <20070709175642.D6C2CD4EABA2@src> Revision: 129252 Author: clattner Date: 2007-07-09 10:56:42 -0700 (Mon, 09 Jul 2007) Log Message: ----------- Enable llvm-gcc to build when LLVM is configured with --enable-expensive-checks. Patch by David Greene! Modified Paths: -------------- apple-local/branches/llvm/gcc/Makefile.in apple-local/branches/llvm/gcc/configure apple-local/branches/llvm/gcc/configure.ac apple-local/branches/llvm/libcpp/configure apple-local/branches/llvm/libcpp/configure.ac Modified: apple-local/branches/llvm/gcc/Makefile.in =================================================================== --- apple-local/branches/llvm/gcc/Makefile.in 2007-07-09 02:28:29 UTC (rev 129251) +++ apple-local/branches/llvm/gcc/Makefile.in 2007-07-09 17:56:42 UTC (rev 129252) @@ -217,26 +217,21 @@ # APPLE LOCAL begin LLVM @checkingenabled_flag@ LLVMOBJDIR = @LLVMBASEPATH@ -ifeq ($(LLVMOBJDIR),) -CPPFLAGS = @CPPFLAGS@ -else -CPPFLAGS = @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS ifdef LLVM_VERSION_INFO CPPFLAGS += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"' endif -ifdef CHECKING_ENABLED -BUILDMODE=Debug -else -ifdef DISABLE_LLVMASSERTIONS -BUILDMODE=Release-Asserts -else -BUILDMODE=Release -endif -endif +# Determine BUILDMODE from configure run (--enable-llvm) +BUILDMODE := @LLVMBUILDMODE@ + LLVMBINPATH = $(LLVMOBJDIR)/$(BUILDMODE)/bin +ifeq ($(LLVMOBJDIR),) +CPPFLAGS = @CPPFLAGS@ +else +CPPFLAGS := @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS $(shell $(LLVMBINPATH)/llvm-config --cppflags) + # Use llvm-config to get the srcdir that LLVM was configured with, to support # srcdir != objdir builds. LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root) Modified: apple-local/branches/llvm/gcc/configure =================================================================== --- apple-local/branches/llvm/gcc/configure 2007-07-09 02:28:29 UTC (rev 129251) +++ apple-local/branches/llvm/gcc/configure 2007-07-09 17:56:42 UTC (rev 129252) @@ -309,7 +309,7 @@ # include #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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_subdir host_subdir target_subdir gcc_version_trigger gcc_version_full gcc_version GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL LLVMBASEPATH SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranl ib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file PACKAGE VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS cc_for_cross_gnattools CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_ objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_cxx_file out_object_file out_cxx_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path GMPLIBS GMPINC LIBOBJS LTLIBOBJS' +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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_subdir host_subdir target_subdir gcc_version_trigger gcc_version_full gcc_version GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL LLVMBASEPATH LLVMBUILDMODE SET_MAKE AWK LN_S LN RANLIB ac_ ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file PACKAGE VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS cc_for_cross_gnattools CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_heade rs_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_cxx_file out_object_file out_cxx_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path GMPLIBS GMPINC LIBOBJS LTLIBOBJS' ac_subst_files='language_hooks' # Initialize some variables set by options. @@ -7089,10 +7089,28 @@ if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then echo Found Release LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then echo Found Debug LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts" + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Checks" + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Checks" + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts+Checks" else { { echo "$as_me:$LINENO: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&5 echo "$as_me: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&2;} @@ -7101,8 +7119,12 @@ else LLVMBASEPATH="" + LLVMBUILDMODE="" + fi; +# Send llvm build mode to gcc Makefiles + # APPLE LOCAL end LLVM # Sanity check enable_languages in case someone does not run the toplevel @@ -7732,7 +7754,7 @@ else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:7735: version of makeinfo is $ac_prog_version" >&5 + echo "configure:7757: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[2-9]*) @@ -16669,6 +16691,7 @@ s, at onestep@,$onestep,;t t s, at DSYMUTIL@,$DSYMUTIL,;t t s, at LLVMBASEPATH@,$LLVMBASEPATH,;t t +s, at LLVMBUILDMODE@,$LLVMBUILDMODE,;t t s, at SET_MAKE@,$SET_MAKE,;t t s, at AWK@,$AWK,;t t s, at LN_S@,$LN_S,;t t Modified: apple-local/branches/llvm/gcc/configure.ac =================================================================== --- apple-local/branches/llvm/gcc/configure.ac 2007-07-09 02:28:29 UTC (rev 129251) +++ apple-local/branches/llvm/gcc/configure.ac 2007-07-09 17:56:42 UTC (rev 129252) @@ -745,16 +745,38 @@ if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then echo Found Release LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then echo Found Debug LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts" + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Checks" + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Checks" + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts+Checks" else AC_MSG_ERROR([You must specify valid path to your LLVM tree with --enable-llvm=DIR]) fi ], -[LLVMBASEPATH=""]) +[LLVMBASEPATH="" + LLVMBUILDMODE="" +]) AC_SUBST(LLVMBASEPATH) +# Send llvm build mode to gcc Makefiles +AC_SUBST(LLVMBUILDMODE) # APPLE LOCAL end LLVM # Sanity check enable_languages in case someone does not run the toplevel Modified: apple-local/branches/llvm/libcpp/configure =================================================================== --- apple-local/branches/llvm/libcpp/configure 2007-07-09 02:28:29 UTC (rev 129251) +++ apple-local/branches/llvm/libcpp/configure 2007-07-09 17:56:42 UTC (rev 129252) @@ -8023,10 +8023,28 @@ if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then echo Found Release LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then echo Found Debug LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts" + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Checks" + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Checks" + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts+Checks" else { { echo "$as_me:$LINENO: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&5 echo "$as_me: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&2;} Modified: apple-local/branches/llvm/libcpp/configure.ac =================================================================== --- apple-local/branches/llvm/libcpp/configure.ac 2007-07-09 02:28:29 UTC (rev 129251) +++ apple-local/branches/llvm/libcpp/configure.ac 2007-07-09 17:56:42 UTC (rev 129252) @@ -108,9 +108,7 @@ case $target in # APPLE LOCAL begin 4126124 alpha*-*-* | \ - #APPLE LOCAL begin LLVM arm*-*-*eabi* | \ - #APPLE LOCAL end LLVM arm*-*-symbianelf* | \ x86_64-*-* | \ ia64-*-* | \ @@ -161,10 +159,28 @@ if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then echo Found Release LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then echo Found Debug LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts" + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Checks" + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Checks" + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts+Checks" else AC_MSG_ERROR([You must specify valid path to your LLVM tree with --enable-llvm=DIR]) fi From clattner at apple.com Mon Jul 9 13:04:06 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Jul 2007 11:04:06 -0700 Subject: [llvm-commits] REPOST: llvm-gcc expensive checks patch In-Reply-To: <200707061151.33902.greened@obbligato.org> References: <200707061151.33902.greened@obbligato.org> Message-ID: <66817935-B9DA-432B-9A47-961FDE272D66@apple.com> On Jul 6, 2007, at 9:51 AM, David A. Greene wrote: > I posted this patch a while back but nothing happened with it. > llvm users who > configure with --enable-expensive-checks are currently unable to build > llvm-gcc without this patch. autoconf must be re-run after > applying it. I applied it: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of- Mon-20070709/051660.html Thanks! I think that "llvm-config --cppflags" should include "- D__STDC_LIMIT_MACROS". What do you think? Also, please don't put markers like "Cray [dag]" into the files. Sorry for the delay! -Chris From evan.cheng at apple.com Mon Jul 9 13:22:21 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 9 Jul 2007 11:22:21 -0700 Subject: [llvm-commits] [llvm] r37843 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp In-Reply-To: <20070709154814.GY5693@village.us.cray.com> References: <20070705144923.GK5693@village.us.cray.com> <8C8471C2-C2F2-4F05-9448-C8BE48737B1C@apple.com> <16e5fdf90707051633n37bdb9bdu2ef96002be91317d@mail.gmail.com> <2E082165-6BB1-465A-AE4B-ED696ED37CFC@apple.com> <15F625BF-09FB-4C24-9EF9-004C2643F370@apple.com> <20070706131057.GO5693@village.us.cray.com> <239AACE9-F6F0-4C93-AF6B-CEF2125D030F@apple.com> <20070709154814.GY5693@village.us.cray.com> Message-ID: On Jul 9, 2007, at 8:48 AM, Dan Gohman wrote: > I found a problem in an interaction between my patch and the > PPCISelLowering.cpp code for lowering call results. The PPC target > code > effectively assigns registers for a call result in reverse order. My > patch was presenting it with registers already in target order. > This is > more consistent with code for other constructs, so it seems best to > fix > the PPCISelLowering.cpp code. Ah, thanks for looking into this. I'd suspected something like this but didn't have time to dig in. > > Attached is a new patch. It's the same change to > SelectionDAGISel.cpp as > before, but it's now accompanied by the PPCISelLowering.cpp update > and a > test case which demonstrates the failure with the previous patch and > passes with the new one. I'll try it out asap. > > Thanks for your help, You bet! Evan > > Dan > > On Fri, Jul 06, 2007 at 01:40:33PM -0700, Evan Cheng wrote: >> This seems to have fixed llvm-test failures, but Mac OS X PPC >> bootstrapping is still unhappy. :-( >> >> Evan >> > > -- > Dan Gohman, Cray Inc. > From resistor at mac.com Mon Jul 9 13:51:16 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 18:51:16 -0000 Subject: [llvm-commits] [llvm] r38467 - /llvm/trunk/lib/Support/SmallPtrSet.cpp Message-ID: <200707091851.l69IpGTo017943@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 13:51:15 2007 New Revision: 38467 URL: http://llvm.org/viewvc/llvm-project?rev=38467&view=rev Log: Fix an error in the assignment operator that was causing an infinite loop in GVNPRE.cpp. Patch by Chis Lattner. Modified: llvm/trunk/lib/Support/SmallPtrSet.cpp Modified: llvm/trunk/lib/Support/SmallPtrSet.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SmallPtrSet.cpp?rev=38467&r1=38466&r2=38467&view=diff ============================================================================== --- llvm/trunk/lib/Support/SmallPtrSet.cpp (original) +++ llvm/trunk/lib/Support/SmallPtrSet.cpp Mon Jul 9 13:51:15 2007 @@ -182,6 +182,8 @@ if (!isSmall()) delete [] CurArray; + NumElements = NumTombstones = 0; + // Get a power of two larger than twice the RHS size. CurArraySize = 1 << Log2_32(RHS.size()*4); @@ -199,12 +201,18 @@ // Now that we know we have enough space, and that the current array is empty, // copy over all the elements from the RHS. - for (void **BucketPtr = RHS.CurArray, **E = RHS.CurArray+RHS.CurArraySize; BucketPtr != E; ++BucketPtr) { // Copy over the element if it is valid. void *Elt = *BucketPtr; - if (Elt != getTombstoneMarker() && Elt != getEmptyMarker()) - *const_cast(FindBucketFor(Elt)) = Elt; + if (Elt != getTombstoneMarker() && Elt != getEmptyMarker()) { + if (isSmall()) + SmallArray[NumElements++] = Elt; + else + *const_cast(FindBucketFor(Elt)) = Elt; + } } + + if (!isSmall()) + NumElements = RHS.NumElements; } From evan.cheng at apple.com Mon Jul 9 15:48:16 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 9 Jul 2007 13:48:16 -0700 Subject: [llvm-commits] [llvm] r37843 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp In-Reply-To: <20070709154814.GY5693@village.us.cray.com> References: <20070705144923.GK5693@village.us.cray.com> <8C8471C2-C2F2-4F05-9448-C8BE48737B1C@apple.com> <16e5fdf90707051633n37bdb9bdu2ef96002be91317d@mail.gmail.com> <2E082165-6BB1-465A-AE4B-ED696ED37CFC@apple.com> <15F625BF-09FB-4C24-9EF9-004C2643F370@apple.com> <20070706131057.GO5693@village.us.cray.com> <239AACE9-F6F0-4C93-AF6B-CEF2125D030F@apple.com> <20070709154814.GY5693@village.us.cray.com> Message-ID: Hi Dan, The patch works great! Please commit. Thanks, Evan On Jul 9, 2007, at 8:48 AM, Dan Gohman wrote: > I found a problem in an interaction between my patch and the > PPCISelLowering.cpp code for lowering call results. The PPC target > code > effectively assigns registers for a call result in reverse order. My > patch was presenting it with registers already in target order. > This is > more consistent with code for other constructs, so it seems best to > fix > the PPCISelLowering.cpp code. > > Attached is a new patch. It's the same change to > SelectionDAGISel.cpp as > before, but it's now accompanied by the PPCISelLowering.cpp update > and a > test case which demonstrates the failure with the previous patch and > passes with the new one. > > Thanks for your help, > > Dan > > On Fri, Jul 06, 2007 at 01:40:33PM -0700, Evan Cheng wrote: >> This seems to have fixed llvm-test failures, but Mac OS X PPC >> bootstrapping is still unhappy. :-( >> >> Evan >> > > -- > Dan Gohman, Cray Inc. > From djg at cray.com Mon Jul 9 15:49:45 2007 From: djg at cray.com (Dan Gohman) Date: Mon, 09 Jul 2007 20:49:45 -0000 Subject: [llvm-commits] [llvm] r38468 - /llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200707092049.l69Knj4n023742@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 9 15:49:44 2007 New Revision: 38468 URL: http://llvm.org/viewvc/llvm-project?rev=38468&view=rev Log: Initialize the IndexedModeActions array with memset before updating it with calls to setIndexedLoadAction/setIndexedStoreAction, which only update a few bits at a time. This avoids ostensible undefined behavior of operationg on values which may be trap-representations, and as a practical matter fixes errors from valgrind, which doesn't track uninitialized memory with bit granularity. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=38468&r1=38467&r2=38468&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Jul 9 15:49:44 2007 @@ -128,7 +128,9 @@ memset(OpActions, 0, sizeof(OpActions)); memset(LoadXActions, 0, sizeof(LoadXActions)); memset(&StoreXActions, 0, sizeof(StoreXActions)); - // Initialize all indexed load / store to expand. + memset(&IndexedModeActions, 0, sizeof(IndexedModeActions)); + + // Set all indexed load / store to expand. for (unsigned VT = 0; VT != (unsigned)MVT::LAST_VALUETYPE; ++VT) { for (unsigned IM = (unsigned)ISD::PRE_INC; IM != (unsigned)ISD::LAST_INDEXED_MODE; ++IM) { From dpatel at apple.com Mon Jul 9 15:52:39 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 09 Jul 2007 20:52:39 -0000 Subject: [llvm-commits] [llvm] r38469 - in /llvm/trunk: include/llvm/Pass.h lib/VMCore/PassManager.cpp Message-ID: <200707092052.l69Kqdlo023844@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jul 9 15:52:39 2007 New Revision: 38469 URL: http://llvm.org/viewvc/llvm-project?rev=38469&view=rev Log: Fix memory leak. Modified: llvm/trunk/include/llvm/Pass.h llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=38469&r1=38468&r2=38469&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Mon Jul 9 15:52:39 2007 @@ -130,8 +130,14 @@ } // Access AnalysisResolver - inline void setResolver(AnalysisResolver *AR) { Resolver = AR; } - inline AnalysisResolver *getResolver() { return Resolver; } + 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 Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=38469&r1=38468&r2=38469&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Jul 9 15:52:39 2007 @@ -1380,9 +1380,6 @@ PM->setTopLevelManager(TPM); } - AnalysisResolver *AR = new AnalysisResolver(*Top); - P->setResolver(AR); - S.push_back(PM); } From resistor at mac.com Mon Jul 9 15:59:01 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 20:59:01 -0000 Subject: [llvm-commits] [llvm] r38470 - in /llvm/trunk: include/llvm/ADT/SmallPtrSet.h lib/Support/SmallPtrSet.cpp Message-ID: <200707092059.l69Kx11Z024039@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 15:59:01 2007 New Revision: 38470 URL: http://llvm.org/viewvc/llvm-project?rev=38470&view=rev Log: Make the assignment operator for SmallPtrSet return a reference, and fix a long-standing bug in the copy ctor while I'm at it. Thanks to Chris Lattner for help with this patch. Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h llvm/trunk/lib/Support/SmallPtrSet.cpp Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallPtrSet.h?rev=38470&r1=38469&r2=38470&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallPtrSet.h (original) +++ llvm/trunk/include/llvm/ADT/SmallPtrSet.h Mon Jul 9 15:59:01 2007 @@ -240,7 +240,7 @@ // Allow assignment from any smallptrset with the same element type even if it // doesn't have the same smallsize. - const SmallPtrSet + const SmallPtrSet& operator=(const SmallPtrSet &RHS) { CopyFrom(RHS); return *this; Modified: llvm/trunk/lib/Support/SmallPtrSet.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SmallPtrSet.cpp?rev=38470&r1=38469&r2=38470&view=diff ============================================================================== --- llvm/trunk/lib/Support/SmallPtrSet.cpp (original) +++ llvm/trunk/lib/Support/SmallPtrSet.cpp Mon Jul 9 15:59:01 2007 @@ -164,7 +164,7 @@ CurArray[CurArraySize] = 0; // Copy over all valid entries. - for (void **BucketPtr = that.CurArray, **E = that.CurArray+CurArraySize; + for (void **BucketPtr = that.CurArray, **E = that.CurArray+that.CurArraySize; BucketPtr != E; ++BucketPtr) { // Copy over the element if it is valid. void *Elt = *BucketPtr; From djg at cray.com Mon Jul 9 15:59:04 2007 From: djg at cray.com (Dan Gohman) Date: Mon, 09 Jul 2007 20:59:04 -0000 Subject: [llvm-commits] [llvm] r38471 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp test/CodeGen/PowerPC/big-endian-call-result.ll Message-ID: <200707092059.l69Kx4x2024053@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 9 15:59:04 2007 New Revision: 38471 URL: http://llvm.org/viewvc/llvm-project?rev=38471&view=rev Log: Change getCopyToParts and getCopyFromParts to always use target-endian register ordering, for both physical and virtual registers. Update the PPC target lowering for calls to expect registers for the call result to already be in target order. Added: llvm/trunk/test/CodeGen/PowerPC/big-endian-call-result.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=38471&r1=38470&r2=38471&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jul 9 15:59:04 2007 @@ -621,7 +621,6 @@ unsigned NumParts, MVT::ValueType PartVT, MVT::ValueType ValueVT, - bool EndianOrder, ISD::NodeType AssertOp = ISD::DELETED_NODE) { if (!MVT::isVector(ValueVT) || NumParts == 1) { SDOperand Val = Parts[0]; @@ -631,7 +630,7 @@ assert(NumParts == 2 && "Cannot expand to more than 2 elts yet!"); SDOperand Hi = Parts[1]; - if (EndianOrder && !DAG.getTargetLoweringInfo().isLittleEndian()) + if (!DAG.getTargetLoweringInfo().isLittleEndian()) std::swap(Val, Hi); return DAG.getNode(ISD::BUILD_PAIR, ValueVT, Val, Hi); } @@ -692,7 +691,7 @@ // as appropriate. for (unsigned i = 0; i != NumParts; ++i) Ops[i] = getCopyFromParts(DAG, &Parts[i], 1, - PartVT, IntermediateVT, EndianOrder); + PartVT, IntermediateVT); } else if (NumParts > 0) { // If the intermediate type was expanded, build the intermediate operands // from the parts. @@ -701,7 +700,7 @@ unsigned Factor = NumIntermediates / NumParts; for (unsigned i = 0; i != NumIntermediates; ++i) Ops[i] = getCopyFromParts(DAG, &Parts[i * Factor], Factor, - PartVT, IntermediateVT, EndianOrder); + PartVT, IntermediateVT); } // Build a vector with BUILD_VECTOR or CONCAT_VECTORS from the intermediate @@ -718,8 +717,7 @@ SDOperand Val, SDOperand *Parts, unsigned NumParts, - MVT::ValueType PartVT, - bool EndianOrder) { + MVT::ValueType PartVT) { MVT::ValueType ValueVT = Val.getValueType(); if (!MVT::isVector(ValueVT) || NumParts == 1) { @@ -728,7 +726,7 @@ for (unsigned i = 0; i != NumParts; ++i) Parts[i] = DAG.getNode(ISD::EXTRACT_ELEMENT, PartVT, Val, DAG.getConstant(i, MVT::i32)); - if (EndianOrder && !DAG.getTargetLoweringInfo().isLittleEndian()) + if (!DAG.getTargetLoweringInfo().isLittleEndian()) std::reverse(Parts, Parts + NumParts); return; } @@ -789,7 +787,7 @@ // 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, EndianOrder); + 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. @@ -797,7 +795,7 @@ "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, EndianOrder); + getCopyToParts(DAG, Ops[i], &Parts[i * Factor], Factor, PartVT); } } @@ -928,7 +926,7 @@ unsigned NumParts = TLI.getNumRegisters(VT); MVT::ValueType PartVT = TLI.getRegisterType(VT); SmallVector Parts(NumParts); - getCopyToParts(DAG, RetOp, &Parts[0], NumParts, PartVT, true); + getCopyToParts(DAG, RetOp, &Parts[0], NumParts, PartVT); for (unsigned i = 0; i < NumParts; ++i) { NewValues.push_back(Parts[i]); NewValues.push_back(DAG.getConstant(false, MVT::i32)); @@ -2952,11 +2950,6 @@ /// If the Flag pointer is NULL, no flag is used. SDOperand RegsForValue::getCopyFromRegs(SelectionDAG &DAG, SDOperand &Chain, SDOperand *Flag)const{ - // Get the list of registers, in the appropriate order. - std::vector R(Regs); - if (!DAG.getTargetLoweringInfo().isLittleEndian()) - std::reverse(R.begin(), R.end()); - // Copy the legal parts from the registers. unsigned NumParts = Regs.size(); SmallVector Parts(NumParts); @@ -2971,7 +2964,7 @@ } // Assemble the legal parts into the final value. - return getCopyFromParts(DAG, &Parts[0], NumParts, RegVT, ValueVT, false); + return getCopyFromParts(DAG, &Parts[0], NumParts, RegVT, ValueVT); } /// getCopyToRegs - Emit a series of CopyToReg nodes that copies the @@ -2980,21 +2973,16 @@ /// 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 registers, in the appropriate order. - std::vector R(Regs); - if (!DAG.getTargetLoweringInfo().isLittleEndian()) - std::reverse(R.begin(), R.end()); - // Get the list of the values's legal parts. unsigned NumParts = Regs.size(); SmallVector Parts(NumParts); - getCopyToParts(DAG, Val, &Parts[0], NumParts, RegVT, false); + getCopyToParts(DAG, Val, &Parts[0], NumParts, RegVT); // Copy the parts into the registers. for (unsigned i = 0; i != NumParts; ++i) { SDOperand Part = Flag ? - DAG.getCopyToReg(Chain, R[i], Parts[i], *Flag) : - DAG.getCopyToReg(Chain, R[i], Parts[i]); + DAG.getCopyToReg(Chain, Regs[i], Parts[i], *Flag) : + DAG.getCopyToReg(Chain, Regs[i], Parts[i]); Chain = Part.getValue(0); if (Flag) *Flag = Part.getValue(1); @@ -3867,7 +3855,7 @@ SmallVector Parts(NumParts); for (unsigned j = 0; j != NumParts; ++j) Parts[j] = SDOperand(Result, i++); - Ops.push_back(getCopyFromParts(DAG, &Parts[0], NumParts, PartVT, VT, true)); + Ops.push_back(getCopyFromParts(DAG, &Parts[0], NumParts, PartVT, VT)); break; } } @@ -3939,7 +3927,7 @@ MVT::ValueType PartVT = getRegisterType(VT); unsigned NumParts = getNumRegisters(VT); SmallVector Parts(NumParts); - getCopyToParts(DAG, Op, &Parts[0], NumParts, PartVT, true); + getCopyToParts(DAG, Op, &Parts[0], NumParts, PartVT); for (unsigned i = 0; i != NumParts; ++i) { // if it isn't first piece, alignment must be 1 unsigned MyFlags = Flags; @@ -3979,7 +3967,7 @@ SmallVector Results(NumRegs); for (unsigned i = 0; i != NumRegs; ++i) Results[i] = Res.getValue(i); - Res = getCopyFromParts(DAG, &Results[0], NumRegs, RegisterVT, VT, false, AssertOp); + Res = getCopyFromParts(DAG, &Results[0], NumRegs, RegisterVT, VT, AssertOp); } return std::make_pair(Res, Chain); @@ -4269,7 +4257,7 @@ SmallVector Chains(NumRegs); // Copy the value by legal parts into sequential virtual registers. - getCopyToParts(DAG, Op, &Regs[0], NumRegs, RegisterVT, false); + getCopyToParts(DAG, Op, &Regs[0], NumRegs, RegisterVT); for (unsigned i = 0; i != NumRegs; ++i) Chains[i] = DAG.getCopyToReg(getRoot(), Reg + i, Regs[i]); return DAG.getNode(ISD::TokenFactor, MVT::Other, &Chains[0], NumRegs); @@ -4406,8 +4394,8 @@ if (TI->getNumSuccessors()) SuccsHandled.resize(BB->getParent()->getNumBlockIDs()); - // Check successor nodes PHI nodes that expect a constant to be available from - // this block. + // 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(SuccBB->begin())) continue; Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=38471&r1=38470&r2=38471&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon Jul 9 15:59:04 2007 @@ -1774,9 +1774,9 @@ case MVT::Other: break; case MVT::i32: if (Op.Val->getValueType(1) == MVT::i32) { - Chain = DAG.getCopyFromReg(Chain, PPC::R4, MVT::i32, InFlag).getValue(1); + Chain = DAG.getCopyFromReg(Chain, PPC::R3, MVT::i32, InFlag).getValue(1); ResultVals[0] = Chain.getValue(0); - Chain = DAG.getCopyFromReg(Chain, PPC::R3, MVT::i32, + Chain = DAG.getCopyFromReg(Chain, PPC::R4, MVT::i32, Chain.getValue(2)).getValue(1); ResultVals[1] = Chain.getValue(0); NumResults = 2; Added: llvm/trunk/test/CodeGen/PowerPC/big-endian-call-result.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/big-endian-call-result.ll?rev=38471&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/big-endian-call-result.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/big-endian-call-result.ll Mon Jul 9 15:59:04 2007 @@ -0,0 +1,13 @@ +; 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 +} From dpatel at apple.com Mon Jul 9 16:19:24 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 09 Jul 2007 21:19:24 -0000 Subject: [llvm-commits] [llvm] r38472 - in /llvm/trunk: include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <200707092119.l69LJOu2025274@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jul 9 16:19:23 2007 New Revision: 38472 URL: http://llvm.org/viewvc/llvm-project?rev=38472&view=rev Log: Expose struct size threhold to allow users to tweak their own setting. Modified: llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=38472&r1=38471&r2=38472&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Mon Jul 9 16:19:23 2007 @@ -76,7 +76,7 @@ // ScalarReplAggregates - Break up alloca's of aggregates into multiple allocas // if possible. // -FunctionPass *createScalarReplAggregatesPass(); +FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1); //===----------------------------------------------------------------------===// // Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=38472&r1=38471&r2=38472&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Mon Jul 9 16:19:23 2007 @@ -48,7 +48,12 @@ namespace { struct VISIBILITY_HIDDEN SROA : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SROA() : FunctionPass((intptr_t)&ID) {} + SROA(signed T = -1) : FunctionPass((intptr_t)&ID) { + if (T == -1) + SRThreshold = 128; + else + SRThreshold = T; + } bool runOnFunction(Function &F); @@ -87,6 +92,8 @@ isMemCpySrc(false), isMemCpyDst(false) {} }; + unsigned SRThreshold; + void MarkUnsafe(AllocaInfo &I) { I.isUnsafe = true; } int isSafeAllocaToScalarRepl(AllocationInst *AI); @@ -119,7 +126,9 @@ } // Public interface to the ScalarReplAggregates pass -FunctionPass *llvm::createScalarReplAggregatesPass() { return new SROA(); } +FunctionPass *llvm::createScalarReplAggregatesPass(signed int Threshold) { + return new SROA(Threshold); +} bool SROA::runOnFunction(Function &F) { @@ -211,7 +220,7 @@ (isa(AI->getAllocatedType()) || isa(AI->getAllocatedType())) && AI->getAllocatedType()->isSized() && - TD.getTypeSize(AI->getAllocatedType()) < 128) { + TD.getTypeSize(AI->getAllocatedType()) < SRThreshold) { // Check that all of the users of the allocation are capable of being // transformed. switch (isSafeAllocaToScalarRepl(AI)) { From djg at cray.com Mon Jul 9 17:18:39 2007 From: djg at cray.com (Dan Gohman) Date: Mon, 09 Jul 2007 22:18:39 -0000 Subject: [llvm-commits] [llvm] r38473 - in /llvm/trunk/lib/CodeGen/SelectionDAG: DAGCombiner.cpp LegalizeDAG.cpp Message-ID: <200707092218.l69MIdcx027334@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 9 17:18:38 2007 New Revision: 38473 URL: http://llvm.org/viewvc/llvm-project?rev=38473&view=rev Log: Preserve volatililty and alignment information when lowering or simplifying loads and stores. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=38473&r1=38472&r2=38473&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Jul 9 17:18:38 2007 @@ -2394,7 +2394,8 @@ LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), N0.getValueType(), - LN0->isVolatile()); + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2872,7 +2873,7 @@ if (Align <= OrigAlign) { SDOperand Load = DAG.getLoad(VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - LN0->isVolatile(), LN0->getAlignment()); + LN0->isVolatile(), Align); AddToWorkList(N); CombineTo(N0.Val, DAG.getNode(ISD::BIT_CONVERT, N0.getValueType(), Load), Load.getValue(1)); @@ -3739,7 +3740,7 @@ 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->getSrcValueOffset(), ST->isVolatile(), Align); } // Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr' @@ -3752,14 +3753,16 @@ if (!AfterLegalize || TLI.isTypeLegal(MVT::i32)) { Tmp = DAG.getConstant(FloatToBits(CFP->getValue()), MVT::i32); return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(), - ST->getSrcValueOffset()); + ST->getSrcValueOffset(), ST->isVolatile(), + ST->getAlignment()); } break; case MVT::f64: if (!AfterLegalize || TLI.isTypeLegal(MVT::i64)) { Tmp = DAG.getConstant(DoubleToBits(CFP->getValue()), MVT::i64); return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(), - ST->getSrcValueOffset()); + ST->getSrcValueOffset(), ST->isVolatile(), + ST->getAlignment()); } else if (TLI.isTypeLegal(MVT::i32)) { // Many FP stores are not make apparent until after legalize, e.g. for // argument passing. Since this is so common, custom legalize the @@ -3769,12 +3772,20 @@ SDOperand Hi = DAG.getConstant(Val >> 32, MVT::i32); if (!TLI.isLittleEndian()) 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()); + ST->getSrcValueOffset(), + isVolatile, ST->getAlignment()); Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, DAG.getConstant(4, Ptr.getValueType())); + SVOffset += 4; + if (Alignment > 4) + Alignment = 4; SDOperand St1 = DAG.getStore(Chain, Hi, Ptr, ST->getSrcValue(), - ST->getSrcValueOffset()+4); + SVOffset, isVolatile, Alignment); return DAG.getNode(ISD::TokenFactor, MVT::Other, St0, St1); } break; @@ -3792,10 +3803,12 @@ SDOperand ReplStore; if (ST->isTruncatingStore()) { ReplStore = DAG.getTruncStore(BetterChain, Value, Ptr, - ST->getSrcValue(),ST->getSrcValueOffset(), ST->getStoredVT()); + ST->getSrcValue(), ST->getSrcValueOffset(), ST->getStoredVT(), + ST->isVolatile(), ST->getAlignment()); } else { ReplStore = DAG.getStore(BetterChain, Value, Ptr, - ST->getSrcValue(), ST->getSrcValueOffset()); + ST->getSrcValue(), ST->getSrcValueOffset(), + ST->isVolatile(), ST->getAlignment()); } // Create token to keep both nodes around. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=38473&r1=38472&r2=38473&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jul 9 17:18:38 2007 @@ -1500,7 +1500,8 @@ MVT::ValueType NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT); Tmp1 = DAG.getLoad(NVT, Tmp1, Tmp2, LD->getSrcValue(), - LD->getSrcValueOffset()); + LD->getSrcValueOffset(), + LD->isVolatile(), LD->getAlignment()); Tmp3 = LegalizeOp(DAG.getNode(ISD::BIT_CONVERT, VT, Tmp1)); Tmp4 = LegalizeOp(Tmp1.getValue(1)); break; @@ -1520,7 +1521,7 @@ "Can only promote extending LOAD from i1 -> i8!"); Result = DAG.getExtLoad(ExtType, Node->getValueType(0), Tmp1, Tmp2, LD->getSrcValue(), LD->getSrcValueOffset(), - MVT::i8); + MVT::i8, LD->isVolatile(), LD->getAlignment()); Tmp1 = Result.getValue(0); Tmp2 = Result.getValue(1); break; @@ -1544,7 +1545,8 @@ // 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->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)); @@ -1555,7 +1557,8 @@ // zero/sign extend inreg. Result = DAG.getExtLoad(ISD::EXTLOAD, Node->getValueType(0), Tmp1, Tmp2, LD->getSrcValue(), - LD->getSrcValueOffset(), SrcVT); + LD->getSrcValueOffset(), SrcVT, + LD->isVolatile(), LD->getAlignment()); SDOperand ValRes; if (ExtType == ISD::SEXTLOAD) ValRes = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(), @@ -1753,6 +1756,9 @@ StoreSDNode *ST = cast(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' @@ -1769,7 +1775,7 @@ Tmp3 = DAG.getConstant(DoubleToBits(CFP->getValue()), MVT::i64); } Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), - ST->getSrcValueOffset()); + SVOffset, isVolatile, Alignment); break; } @@ -1792,7 +1798,8 @@ Tmp3 = DAG.getNode(ISD::BIT_CONVERT, TLI.getTypeToPromoteTo(ISD::STORE, VT), Tmp3); Result = DAG.getStore(Tmp1, Tmp3, Tmp2, - ST->getSrcValue(), ST->getSrcValueOffset()); + ST->getSrcValue(), SVOffset, isVolatile, + Alignment); break; } break; @@ -1801,7 +1808,8 @@ // Truncate the value and store the result. Tmp3 = PromoteOp(ST->getValue()); Result = DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), - ST->getSrcValueOffset(), ST->getStoredVT()); + SVOffset, ST->getStoredVT(), + isVolatile, Alignment); break; case Expand: @@ -1823,18 +1831,14 @@ // Turn this into a normal store of the vector type. Tmp3 = LegalizeOp(Node->getOperand(1)); Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), - ST->getSrcValueOffset(), - ST->isVolatile(), - ST->getAlignment()); + SVOffset, isVolatile, Alignment); Result = LegalizeOp(Result); break; } else if (NumElems == 1) { // Turn this into a normal store of the scalar type. Tmp3 = ScalarizeVectorOp(Node->getOperand(1)); Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), - ST->getSrcValueOffset(), - ST->isVolatile(), - ST->getAlignment()); + 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); @@ -1852,8 +1856,7 @@ } Lo = DAG.getStore(Tmp1, Lo, Tmp2, ST->getSrcValue(), - ST->getSrcValueOffset(), ST->isVolatile(), - ST->getAlignment()); + SVOffset, isVolatile, Alignment); if (Hi.Val == NULL) { // Must be int <-> float one-to-one expansion. @@ -1865,11 +1868,11 @@ getIntPtrConstant(IncrementSize)); assert(isTypeLegal(Tmp2.getValueType()) && "Pointers must be legal!"); - // FIXME: This sets the srcvalue of both halves to be the same, which is - // wrong. + SVOffset += IncrementSize; + if (Alignment > IncrementSize) + Alignment = IncrementSize; Hi = DAG.getStore(Tmp1, Hi, Tmp2, ST->getSrcValue(), - ST->getSrcValueOffset(), ST->isVolatile(), - std::min(ST->getAlignment(), IncrementSize)); + SVOffset, isVolatile, Alignment); Result = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi); break; } @@ -1887,7 +1890,8 @@ Tmp3 = DAG.getNode(ISD::AND, Tmp3.getValueType(), Tmp3, DAG.getConstant(1, Tmp3.getValueType())); Result = DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), - ST->getSrcValueOffset(), MVT::i8); + SVOffset, MVT::i8, + isVolatile, Alignment); } else if (Tmp1 != ST->getChain() || Tmp3 != ST->getValue() || Tmp2 != ST->getBasePtr()) { Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp3, Tmp2, @@ -3494,7 +3498,9 @@ Result = DAG.getExtLoad(ExtType, NVT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(), LD->getSrcValueOffset(), - LD->getLoadedVT()); + LD->getLoadedVT(), + LD->isVolatile(), + LD->getAlignment()); // Remember that we legalized the chain. AddLegalizedOperand(Op.getValue(1), LegalizeOp(Result.getValue(1))); break; @@ -4848,10 +4854,13 @@ SDOperand Ch = LD->getChain(); // Legalize the chain. SDOperand Ptr = LD->getBasePtr(); // Legalize the pointer. ISD::LoadExtType ExtType = LD->getExtensionType(); - unsigned SVOffset = LD->getSrcValueOffset(); + 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); + 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. @@ -4867,7 +4876,10 @@ Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, getIntPtrConstant(IncrementSize)); SVOffset += IncrementSize; - Hi = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(), SVOffset); + if (Alignment > IncrementSize) + 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. @@ -4884,7 +4896,7 @@ if (VT == MVT::f64 && EVT == MVT::f32) { // f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND SDOperand Load = DAG.getLoad(EVT, Ch, Ptr, LD->getSrcValue(), - SVOffset); + 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); @@ -4893,10 +4905,11 @@ if (EVT == NVT) Lo = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(), - SVOffset); + SVOffset, isVolatile, Alignment); else Lo = DAG.getExtLoad(ExtType, NVT, Ch, Ptr, LD->getSrcValue(), - SVOffset, EVT); + SVOffset, EVT, isVolatile, + Alignment); // Remember that we legalized the chain. AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Lo.getValue(1))); From resistor at mac.com Mon Jul 9 17:27:20 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 22:27:20 -0000 Subject: [llvm-commits] [llvm] r38474 - /llvm/trunk/lib/Support/SmallPtrSet.cpp Message-ID: <200707092227.l69MRKml027603@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 17:27:20 2007 New Revision: 38474 URL: http://llvm.org/viewvc/llvm-project?rev=38474&view=rev Log: Make the assignment operator for SmallPtrSet much faster for normal cases. Modified: llvm/trunk/lib/Support/SmallPtrSet.cpp Modified: llvm/trunk/lib/Support/SmallPtrSet.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SmallPtrSet.cpp?rev=38474&r1=38473&r2=38474&view=diff ============================================================================== --- llvm/trunk/lib/Support/SmallPtrSet.cpp (original) +++ llvm/trunk/lib/Support/SmallPtrSet.cpp Mon Jul 9 17:27:20 2007 @@ -177,42 +177,27 @@ /// 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) { - // Allocate space if needed or clear the current elements out of the array. - if (CurArraySize < RHS.size()*2) { - if (!isSmall()) - delete [] CurArray; - - NumElements = NumTombstones = 0; - - // Get a power of two larger than twice the RHS size. - CurArraySize = 1 << Log2_32(RHS.size()*4); - - // Install the new array. Clear all the buckets to empty. - CurArray = new void*[CurArraySize+1]; - memset(CurArray, -1, CurArraySize*sizeof(void*)); - - // The end pointer, always valid, is set to a valid element to help the - // iterator. - CurArray[CurArraySize] = 0; - - } else if (!empty()) { - clear(); - } + if (isSmall() && RHS.isSmall()) + assert(CurArraySize == RHS.CurArraySize && + "Cannot assign sets with different small sizes"); + NumElements = RHS.NumElements; + NumTombstones = RHS.NumTombstones; - // Now that we know we have enough space, and that the current array is empty, - // copy over all the elements from the RHS. - for (void **BucketPtr = RHS.CurArray, **E = RHS.CurArray+RHS.CurArraySize; - BucketPtr != E; ++BucketPtr) { - // Copy over the element if it is valid. - void *Elt = *BucketPtr; - if (Elt != getTombstoneMarker() && Elt != getEmptyMarker()) { - if (isSmall()) - SmallArray[NumElements++] = Elt; - else - *const_cast(FindBucketFor(Elt)) = Elt; - } - } + // If we're not currently small, and we don't have the same heap size, + // free our heap allocated storage + if (!isSmall() && CurArraySize != RHS.CurArraySize) + delete [] CurArray; - if (!isSmall()) - NumElements = RHS.NumElements; + // If we're becoming small, prepare to insert into our stack space + if (RHS.isSmall()) + CurArray = &SmallArray[0]; + // Otherwise, allocate new heap space (unless we were the same size) + else if (CurArraySize != RHS.CurArraySize) + CurArray = new void*[RHS.CurArraySize+1]; + + // 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)); } From resistor at mac.com Mon Jul 9 17:29:51 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 22:29:51 -0000 Subject: [llvm-commits] [llvm] r38475 - /llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Message-ID: <200707092229.l69MTpKJ027720@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 17:29:50 2007 New Revision: 38475 URL: http://llvm.org/viewvc/llvm-project?rev=38475&view=rev Log: Take advantage of the new fast SmallPtrSet assignment operator when propagating AVAIL_OUT sets. This reduces the time to optimize Anton's testcase from 31.2s to 21.s! Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=38475&r1=38474&r2=38475&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Jul 9 17:29:50 2007 @@ -574,7 +574,8 @@ numbers.set(i); } - void copyNumbers(ValueNumberedSet& other) { + void operator=(const ValueNumberedSet& other) { + contents = other.contents; numbers = other.numbers; } @@ -710,11 +711,10 @@ void GVNPRE::val_replace(ValueNumberedSet& s, Value* v) { uint32_t num = VN.lookup(v); Value* leader = find_leader(s, num); - while (leader != 0) { + if (leader != 0) s.erase(leader); - leader = find_leader(s, num); - } s.insert(v); + s.set(num); } /// phi_translate - Given a value, its parent block, and a predecessor of its @@ -1154,8 +1154,6 @@ /// elimination by walking the dominator tree and removing any instruction that /// is dominated by another instruction with the same value number. bool GVNPRE::elimination() { - DOUT << "\n\nPhase 3: Elimination\n\n"; - bool changed_function = false; std::vector > replace; @@ -1167,10 +1165,6 @@ E = df_end(DT.getRootNode()); DI != E; ++DI) { BasicBlock* BB = DI->getBlock(); - //DOUT << "Block: " << BB->getName() << "\n"; - //dump(availableOut[BB]); - //DOUT << "\n\n"; - for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) { @@ -1354,7 +1348,6 @@ if (BB->getTerminator()->getNumSuccessors() == 1) { if (BB->getTerminator()->getSuccessor(0) != BB && visited.count(BB->getTerminator()->getSuccessor(0)) == 0) { - DOUT << "DEFER: " << BB->getName() << "\n"; return true; } else { @@ -1459,12 +1452,8 @@ BasicBlock* BB = DI->getBlock(); // A block inherits AVAIL_OUT from its dominator - if (DI->getIDom() != 0) { - currAvail.insert(availableOut[DI->getIDom()->getBlock()].begin(), - availableOut[DI->getIDom()->getBlock()].end()); - - currAvail.copyNumbers(availableOut[DI->getIDom()->getBlock()]); - } + if (DI->getIDom() != 0) + currAvail = availableOut[DI->getIDom()->getBlock()]; for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) @@ -1517,8 +1506,6 @@ iterations++; } - - DOUT << "ITERATIONS: " << iterations << "\n"; } /// insertion_pre - When a partial redundancy has been identified, eliminate it @@ -1528,7 +1515,6 @@ std::map& avail, std::map& new_sets) { for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI) { - DOUT << "PRED: " << (*PI)->getName() << "\n"; Value* e2 = avail[*PI]; if (!availableOut[*PI].test(VN.lookup(e2))) { User* U = cast(e2); From resistor at mac.com Mon Jul 9 18:39:40 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 23:39:40 -0000 Subject: [llvm-commits] [llvm] r38476 - /llvm/trunk/include/llvm/ADT/BitVector.h Message-ID: <200707092339.l69NdeBn029766@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 18:39:39 2007 New Revision: 38476 URL: http://llvm.org/viewvc/llvm-project?rev=38476&view=rev Log: When resizing a BitVector with size 0, be sure to clear the low word before using it. Modified: llvm/trunk/include/llvm/ADT/BitVector.h Modified: llvm/trunk/include/llvm/ADT/BitVector.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/BitVector.h?rev=38476&r1=38475&r2=38476&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/BitVector.h (original) +++ llvm/trunk/include/llvm/ADT/BitVector.h Mon Jul 9 18:39:39 2007 @@ -185,6 +185,11 @@ grow(N); init_words(&Bits[OldCapacity], (Capacity-OldCapacity), t); } + + // If we previously had no size, initialize the low word + if (Size == 0) + Bits[0] = t; + Size = N; clear_unused_bits(); } From resistor at mac.com Mon Jul 9 18:57:18 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 09 Jul 2007 23:57:18 -0000 Subject: [llvm-commits] [llvm] r38477 - /llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Message-ID: <200707092357.l69NvIDW030235@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 18:57:18 2007 New Revision: 38477 URL: http://llvm.org/viewvc/llvm-project?rev=38477&view=rev Log: Add an assertion if find_leader fails. Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=38477&r1=38476&r2=38477&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Jul 9 18:57:18 2007 @@ -695,6 +695,7 @@ if (v == VN.lookup(*I)) return *I; + assert(0 && "No leader found, but present bit is set?"); return 0; } From djg at cray.com Mon Jul 9 19:05:58 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 10 Jul 2007 00:05:58 -0000 Subject: [llvm-commits] [llvm] r38478 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td X86RegisterInfo.cpp Message-ID: <200707100005.l6A05w1A030461@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 9 19:05:58 2007 New Revision: 38478 URL: http://llvm.org/viewvc/llvm-project?rev=38478&view=rev Log: Define non-intrinsic instructions for vector min, max, sqrt, rsqrt, and rcp, in addition to the intrinsic forms. Add spill-folding entries for these new instructions, and for the scalar min and max instrinsic instructions which were missing. And add some preliminary ISelLowering code for using the new non-intrinsic vector sqrt instruction, and fneg and fabs. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=38478&r1=38477&r2=38478&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jul 9 19:05:58 2007 @@ -331,6 +331,13 @@ 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); } if (Subtarget->hasMMX()) { @@ -408,6 +415,9 @@ 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::FABS, MVT::v4f32, Custom); setOperationAction(ISD::LOAD, MVT::v4f32, Legal); setOperationAction(ISD::BUILD_VECTOR, MVT::v4f32, Custom); setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v4f32, Custom); @@ -435,6 +445,9 @@ 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::FABS, MVT::v2f64, Custom); setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v16i8, Custom); setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i16, Custom); @@ -3326,16 +3339,21 @@ SDOperand X86TargetLowering::LowerFABS(SDOperand Op, SelectionDAG &DAG) { MVT::ValueType VT = Op.getValueType(); - const Type *OpNTy = MVT::getTypeForValueType(VT); + MVT::ValueType EltVT = VT; + if (MVT::isVector(VT)) + EltVT = MVT::getVectorElementType(VT); + const Type *OpNTy = MVT::getTypeForValueType(EltVT); std::vector CV; - if (VT == MVT::f64) { - CV.push_back(ConstantFP::get(OpNTy, BitsToDouble(~(1ULL << 63)))); - CV.push_back(ConstantFP::get(OpNTy, 0.0)); + if (EltVT == MVT::f64) { + Constant *C = ConstantFP::get(OpNTy, BitsToDouble(~(1ULL << 63))); + CV.push_back(C); + CV.push_back(C); } else { - CV.push_back(ConstantFP::get(OpNTy, BitsToFloat(~(1U << 31)))); - CV.push_back(ConstantFP::get(OpNTy, 0.0)); - CV.push_back(ConstantFP::get(OpNTy, 0.0)); - CV.push_back(ConstantFP::get(OpNTy, 0.0)); + Constant *C = ConstantFP::get(OpNTy, BitsToFloat(~(1U << 31))); + CV.push_back(C); + CV.push_back(C); + CV.push_back(C); + CV.push_back(C); } Constant *CS = ConstantStruct::get(CV); SDOperand CPIdx = DAG.getConstantPool(CS, getPointerTy(), 4); @@ -3350,16 +3368,21 @@ SDOperand X86TargetLowering::LowerFNEG(SDOperand Op, SelectionDAG &DAG) { MVT::ValueType VT = Op.getValueType(); - const Type *OpNTy = MVT::getTypeForValueType(VT); + MVT::ValueType EltVT = VT; + if (MVT::isVector(VT)) + EltVT = MVT::getVectorElementType(VT); + const Type *OpNTy = MVT::getTypeForValueType(EltVT); std::vector CV; - if (VT == MVT::f64) { - CV.push_back(ConstantFP::get(OpNTy, BitsToDouble(1ULL << 63))); - CV.push_back(ConstantFP::get(OpNTy, 0.0)); + if (EltVT == MVT::f64) { + Constant *C = ConstantFP::get(OpNTy, BitsToDouble(1ULL << 63)); + CV.push_back(C); + CV.push_back(C); } else { - CV.push_back(ConstantFP::get(OpNTy, BitsToFloat(1U << 31))); - CV.push_back(ConstantFP::get(OpNTy, 0.0)); - CV.push_back(ConstantFP::get(OpNTy, 0.0)); - CV.push_back(ConstantFP::get(OpNTy, 0.0)); + Constant *C = ConstantFP::get(OpNTy, BitsToFloat(1U << 31)); + CV.push_back(C); + CV.push_back(C); + CV.push_back(C); + CV.push_back(C); } Constant *CS = ConstantStruct::get(CV); SDOperand CPIdx = DAG.getConstantPool(CS, getPointerTy(), 4); @@ -4284,6 +4307,8 @@ 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"; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=38478&r1=38477&r2=38478&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon Jul 9 19:05:58 2007 @@ -177,6 +177,12 @@ /// 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, + // Thread Local Storage TLSADDR, THREAD_POINTER }; Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=38478&r1=38477&r2=38478&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Jul 9 19:05:58 2007 @@ -31,6 +31,8 @@ [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, [SDNPHasChain, SDNPOutFlag]>; @@ -247,16 +249,6 @@ class PSIi8 o, Format F, dag ops, string asm, list pattern> : Ii8, TB, Requires<[HasSSE1]>; -// Helpers for defining instructions that directly correspond to intrinsics. -multiclass SS_IntUnary o, string OpcodeStr, Intrinsic IntId> { - def r : SSI; - def m : SSI; -} - // Move Instructions def MOVSSrr : SSI<0x10, MRMSrcReg, (ops FR32:$dst, FR32:$src), "movss {$src, $dst|$dst, $src}", []>; @@ -267,18 +259,6 @@ "movss {$src, $dst|$dst, $src}", [(store FR32:$src, addr:$dst)]>; -def SQRTSSr : SSI<0x51, MRMSrcReg, (ops FR32:$dst, FR32:$src), - "sqrtss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (fsqrt FR32:$src))]>; -def SQRTSSm : SSI<0x51, MRMSrcMem, (ops FR32:$dst, f32mem:$src), - "sqrtss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (fsqrt (loadf32 addr:$src)))]>; - -// Aliases to match intrinsics which expect XMM operand(s). -defm SQRTSS_Int : SS_IntUnary<0x51, "sqrtss" , int_x86_sse_sqrt_ss>; -defm RSQRTSS_Int : SS_IntUnary<0x52, "rsqrtss", int_x86_sse_rsqrt_ss>; -defm RCPSS_Int : SS_IntUnary<0x53, "rcpss" , int_x86_sse_rcp_ss>; - // Conversion instructions def CVTTSS2SIrr : SSI<0x2C, MRMSrcReg, (ops GR32:$dst, FR32:$src), "cvttss2si {$src, $dst|$dst, $src}", @@ -425,20 +405,20 @@ "andnps {$src2, $dst|$dst, $src2}", []>; } -/// scalar_sse1_fp_binop_rm - Scalar SSE1 binops come in three basic forms: -/// -/// 1. f32 - This comes in SSE1 form for floats. -/// 2. rr vs rm - They include a reg+reg form and a reg+mem form. -/// -/// In addition, scalar SSE ops have an intrinsic form. This form is unlike the -/// normal form, in that they take an entire vector (instead of a scalar) and -/// leave the top elements undefined. This adds another two variants of the -/// above permutations, giving us 8 forms for 'instruction'. +/// 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 isTwoAddress = 1 in { -multiclass scalar_sse1_fp_binop_rm opc, string OpcodeStr, - SDNode OpNode, Intrinsic F32Int, - bit Commutable = 0> { +multiclass basic_sse1_fp_binop_rm opc, string OpcodeStr, + SDNode OpNode, Intrinsic F32Int, + bit Commutable = 0> { // Scalar operation, reg+reg. def SSrr : SSI; - // Vector intrinsic operation, reg+reg. + // Vector operation, reg+reg. + def PSrr : PSI { + let isCommutable = Commutable; + } + + // Vector operation, reg+mem. + def PSrm : PSI; + + // Intrinsic operation, reg+reg. def SSrr_Int : SSI { let isCommutable = Commutable; } - // Vector intrinsic operation, reg+mem. + // Intrinsic operation, reg+mem. def SSrm_Int : SSI; -defm MUL : scalar_sse1_fp_binop_rm<0x59, "mul", fmul, int_x86_sse_mul_ss, 1>; -defm SUB : scalar_sse1_fp_binop_rm<0x5C, "sub", fsub, int_x86_sse_sub_ss>; -defm DIV : scalar_sse1_fp_binop_rm<0x5E, "div", fdiv, int_x86_sse_div_ss>; +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>; -defm MAX : scalar_sse1_fp_binop_rm<0x5F, "max", X86fmax, int_x86_sse_max_ss>; -defm MIN : scalar_sse1_fp_binop_rm<0x5D, "min", X86fmin, int_x86_sse_min_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 isTwoAddress = 1 in { +multiclass sse1_fp_binop_rm opc, string OpcodeStr, + SDNode OpNode, + Intrinsic F32Int, + Intrinsic V4F32Int, + bit Commutable = 0> { + + // Scalar operation, reg+reg. + def SSrr : SSI { + let isCommutable = Commutable; + } + + // Scalar operation, reg+mem. + def SSrm : SSI; + + // Vector operation, reg+reg. + def PSrr : PSI { + let isCommutable = Commutable; + } + + // Vector operation, reg+mem. + def PSrm : PSI; + + // Intrinsic operation, reg+reg. + def SSrr_Int : SSI { + let isCommutable = Commutable; + } + + // Intrinsic operation, reg+mem. + def SSrm_Int : SSI; + + // Vector intrinsic operation, reg+reg. + def PSrr_Int : PSI { + let isCommutable = Commutable; + } + + // Vector intrinsic operation, reg+mem. + def PSrm_Int : PSI; +} +} + +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 @@ -550,69 +611,84 @@ -/// packed_sse1_fp_binop_rm - Packed SSE binops come in three basic forms: -/// 1. v4f32 - This comes in SSE1 form for float. -/// 2. rr vs rm - They include a reg+reg form and a ref+mem form. +// Arithmetic + +/// sse1_fp_unop_rm - SSE1 unops come in both scalar and vector forms. /// -let isTwoAddress = 1 in { -multiclass packed_sse1_fp_binop_rm opc, string OpcodeStr, - SDNode OpNode, bit Commutable = 0> { - // Packed operation, reg+reg. - def PSrr : PSI { +/// 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 opc, string OpcodeStr, + SDNode OpNode, + Intrinsic F32Int, + Intrinsic V4F32Int, + bit Commutable = 0> { + // Scalar operation, reg. + def SSr : SSI { let isCommutable = Commutable; } - // Packed operation, reg+mem. - def PSrm : PSI; -} -} - -defm ADD : packed_sse1_fp_binop_rm<0x58, "add", fadd, 1>; -defm MUL : packed_sse1_fp_binop_rm<0x59, "mul", fmul, 1>; -defm DIV : packed_sse1_fp_binop_rm<0x5E, "div", fdiv>; -defm SUB : packed_sse1_fp_binop_rm<0x5C, "sub", fsub>; - -// Arithmetic - -class PS_Intr o, string OpcodeStr, Intrinsic IntId> - : PSI; -class PS_Intm o, string OpcodeStr, Intrinsic IntId> - : PSI; - -class PS_Intrr o, string OpcodeStr, Intrinsic IntId> - : PSI; -class PS_Intrm o, string OpcodeStr, Intrinsic IntId> - : PSI; - -def SQRTPSr : PS_Intr<0x51, "sqrtps", int_x86_sse_sqrt_ps>; -def SQRTPSm : PS_Intm<0x51, "sqrtps", int_x86_sse_sqrt_ps>; + // Scalar operation, mem. + def SSm : SSI; + + // Vector operation, reg. + def PSr : PSI { + let isCommutable = Commutable; + } -def RSQRTPSr : PS_Intr<0x52, "rsqrtps", int_x86_sse_rsqrt_ps>; -def RSQRTPSm : PS_Intm<0x52, "rsqrtps", int_x86_sse_rsqrt_ps>; -def RCPPSr : PS_Intr<0x53, "rcpps", int_x86_sse_rcp_ps>; -def RCPPSm : PS_Intm<0x53, "rcpps", int_x86_sse_rcp_ps>; + // Vector operation, mem. + def PSm : PSI; + + // Intrinsic operation, reg. + def SSr_Int : SSI { + let isCommutable = Commutable; + } -let isTwoAddress = 1 in { - let isCommutable = 1 in { - def MAXPSrr : PS_Intrr<0x5F, "maxps", int_x86_sse_max_ps>; - def MINPSrr : PS_Intrr<0x5D, "minps", int_x86_sse_min_ps>; + // Intrinsic operation, mem. + def SSm_Int : SSI; + + // Vector intrinsic operation, reg + def PSr_Int : PSI { + let isCommutable = Commutable; } - def MAXPSrm : PS_Intrm<0x5F, "maxps", int_x86_sse_max_ps>; - def MINPSrm : PS_Intrm<0x5D, "minps", int_x86_sse_min_ps>; -} + // Vector intrinsic operation, mem + def PSm_Int : PSI; +} + +// 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 isTwoAddress = 1 in { @@ -835,16 +911,6 @@ class PDIi8 o, Format F, dag ops, string asm, list pattern> : Ii8, TB, OpSize, Requires<[HasSSE2]>; -// Helpers for defining instructions that directly correspond to intrinsics. -multiclass SD_IntUnary o, string OpcodeStr, Intrinsic IntId> { - def r : SDI; - def m : SDI; -} - // Move Instructions def MOVSDrr : SDI<0x10, MRMSrcReg, (ops FR64:$dst, FR64:$src), "movsd {$src, $dst|$dst, $src}", []>; @@ -855,16 +921,6 @@ "movsd {$src, $dst|$dst, $src}", [(store FR64:$src, addr:$dst)]>; -def SQRTSDr : SDI<0x51, MRMSrcReg, (ops FR64:$dst, FR64:$src), - "sqrtsd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (fsqrt FR64:$src))]>; -def SQRTSDm : SDI<0x51, MRMSrcMem, (ops FR64:$dst, f64mem:$src), - "sqrtsd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (fsqrt (loadf64 addr:$src)))]>; - -// Aliases to match intrinsics which expect XMM operand(s). -defm SQRTSD_Int : SD_IntUnary<0x51, "sqrtsd" , int_x86_sse2_sqrt_sd>; - // Conversion instructions def CVTTSD2SIrr : SDI<0x2C, MRMSrcReg, (ops GR32:$dst, FR64:$src), "cvttsd2si {$src, $dst|$dst, $src}", @@ -1013,20 +1069,20 @@ "andnpd {$src2, $dst|$dst, $src2}", []>; } -/// scalar_sse2_fp_binop_rm - Scalar SSE2 binops come in three basic forms: -/// -/// 1. f64 - This comes in SSE2 form for doubles. -/// 2. rr vs rm - They include a reg+reg form and a reg+mem form. -/// -/// In addition, scalar SSE ops have an intrinsic form. This form is unlike the -/// normal form, in that they take an entire vector (instead of a scalar) and -/// leave the top elements undefined. This adds another two variants of the -/// above permutations, giving us 8 forms for 'instruction'. +/// 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 isTwoAddress = 1 in { -multiclass scalar_sse2_fp_binop_rm opc, string OpcodeStr, - SDNode OpNode, Intrinsic F64Int, - bit Commutable = 0> { +multiclass basic_sse2_fp_binop_rm opc, string OpcodeStr, + SDNode OpNode, Intrinsic F64Int, + bit Commutable = 0> { // Scalar operation, reg+reg. def SDrr : SDI; - // Vector intrinsic operation, reg+reg. + // Vector operation, reg+reg. + def PDrr : PDI { + let isCommutable = Commutable; + } + + // Vector operation, reg+mem. + def PDrm : PDI; + + // Intrinsic operation, reg+reg. def SDrr_Int : SDI { let isCommutable = Commutable; } - // Vector intrinsic operation, reg+mem. + // Intrinsic operation, reg+mem. def SDrm_Int : SDI; -defm MUL : scalar_sse2_fp_binop_rm<0x59, "mul", fmul, int_x86_sse2_mul_sd, 1>; -defm SUB : scalar_sse2_fp_binop_rm<0x5C, "sub", fsub, int_x86_sse2_sub_sd>; -defm DIV : scalar_sse2_fp_binop_rm<0x5E, "div", fdiv, int_x86_sse2_div_sd>; +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>; -defm MAX : scalar_sse2_fp_binop_rm<0x5F, "max", X86fmax, int_x86_sse2_max_sd>; -defm MIN : scalar_sse2_fp_binop_rm<0x5D, "min", X86fmin, int_x86_sse2_min_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 isTwoAddress = 1 in { +multiclass sse2_fp_binop_rm opc, string OpcodeStr, + SDNode OpNode, + Intrinsic F64Int, + Intrinsic V2F64Int, + bit Commutable = 0> { + + // Scalar operation, reg+reg. + def SDrr : SDI { + let isCommutable = Commutable; + } + + // Scalar operation, reg+mem. + def SDrm : SDI; + + // Vector operation, reg+reg. + def PDrr : PDI { + let isCommutable = Commutable; + } + + // Vector operation, reg+mem. + def PDrm : PDI; + + // Intrinsic operation, reg+reg. + def SDrr_Int : SDI { + let isCommutable = Commutable; + } + + // Intrinsic operation, reg+mem. + def SDrm_Int : SDI; + + // Vector intrinsic operation, reg+reg. + def PDrr_Int : PDI { + let isCommutable = Commutable; + } + + // Vector intrinsic operation, reg+mem. + def PDrm_Int : PDI; +} +} + +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 @@ -1234,65 +1371,80 @@ Requires<[HasSSE2]>; } -/// packed_sse2_fp_binop_rm - Packed SSE binops come in three basic forms: -/// 1. v2f64 - This comes in SSE2 form for doubles. -/// 2. rr vs rm - They include a reg+reg form and a ref+mem form. +// Arithmetic + +/// sse2_fp_unop_rm - SSE2 unops come in both scalar and vector forms. /// -let isTwoAddress = 1 in { -multiclass packed_sse2_fp_binop_rm opc, string OpcodeStr, - SDNode OpNode, bit Commutable = 0> { - // Packed operation, reg+reg. - def PDrr : PDI { +/// 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 opc, string OpcodeStr, + SDNode OpNode, + Intrinsic F64Int, + Intrinsic V2F64Int, + bit Commutable = 0> { + // Scalar operation, reg. + def SDr : SDI { let isCommutable = Commutable; } - // Packed operation, reg+mem. - def PDrm : PDI; -} -} - -defm ADD : packed_sse2_fp_binop_rm<0x58, "add", fadd, 1>; -defm MUL : packed_sse2_fp_binop_rm<0x59, "mul", fmul, 1>; -defm DIV : packed_sse2_fp_binop_rm<0x5E, "div", fdiv>; -defm SUB : packed_sse2_fp_binop_rm<0x5C, "sub", fsub>; - -// Arithmetic - -class PD_Intr o, string OpcodeStr, Intrinsic IntId> - : PDI; -class PD_Intm o, string OpcodeStr, Intrinsic IntId> - : PDI; - -class PD_Intrr o, string OpcodeStr, Intrinsic IntId> - : PDI; -class PD_Intrm o, string OpcodeStr, Intrinsic IntId> - : PDI; + // Scalar operation, mem. + def SDm : SDI; + + // Vector operation, reg. + def PDr : PDI { + let isCommutable = Commutable; + } -def SQRTPDr : PD_Intr<0x51, "sqrtpd", int_x86_sse2_sqrt_pd>; -def SQRTPDm : PD_Intm<0x51, "sqrtpd", int_x86_sse2_sqrt_pd>; + // Vector operation, mem. + def PDm : PDI; + + // Intrinsic operation, reg. + def SDr_Int : SDI { + let isCommutable = Commutable; + } -let isTwoAddress = 1 in { - let isCommutable = 1 in { - def MAXPDrr : PD_Intrr<0x5F, "maxpd", int_x86_sse2_max_pd>; - def MINPDrr : PD_Intrr<0x5D, "minpd", int_x86_sse2_min_pd>; + // Intrinsic operation, mem. + def SDm_Int : SDI; + + // Vector intrinsic operation, reg + def PDr_Int : PDI { + let isCommutable = Commutable; } - def MAXPDrm : PD_Intrm<0x5F, "maxpd", int_x86_sse2_max_pd>; - def MINPDrm : PD_Intrm<0x5D, "minpd", int_x86_sse2_min_pd>; + // Vector intrinsic operation, mem + def PDm_Int : PDI; } +// 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 isTwoAddress = 1 in { let isCommutable = 1 in { Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=38478&r1=38477&r2=38478&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Jul 9 19:05:58 2007 @@ -758,9 +758,21 @@ { X86::IMUL16rr, X86::IMUL16rm }, { X86::IMUL32rr, X86::IMUL32rm }, { 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 }, @@ -825,15 +837,23 @@ { X86::PUNPCKLWDrr, X86::PUNPCKLWDrm }, { X86::PXORrr, X86::PXORrm }, { 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::SBB32rr, X86::SBB32rm }, { X86::SBB64rr, X86::SBB64rm }, { X86::SHUFPDrri, X86::SHUFPDrmi }, { X86::SHUFPSrri, X86::SHUFPSrmi }, { 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::SUB16rr, X86::SUB16rm }, { X86::SUB32rr, X86::SUB32rm }, { X86::SUB64rr, X86::SUB64rm }, From resistor at mac.com Mon Jul 9 19:09:26 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 00:09:26 -0000 Subject: [llvm-commits] [llvm] r38479 - /llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Message-ID: <200707100009.l6A09QtH030594@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 19:09:25 2007 New Revision: 38479 URL: http://llvm.org/viewvc/llvm-project?rev=38479&view=rev Log: Use a cheaper test, delaying calling find_leader() until we know that it's necessary. This improves the time to optimize Anton's testcase from 21.1s to 17.6s. Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=38479&r1=38478&r2=38479&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Jul 9 19:09:25 2007 @@ -565,6 +565,7 @@ 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) { @@ -1173,15 +1174,16 @@ isa(BI) || isa(BI) || isa(BI) || isa(BI) || isa(BI) || isa(BI)) { - Value *leader = find_leader(availableOut[BB], VN.lookup(BI)); - - if (leader != 0) + + 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(leader)) if (Instr->getParent() != 0 && Instr != BI) { replace.push_back(std::make_pair(BI, leader)); erase.push_back(BI); ++NumEliminated; } + } } } } From clattner at apple.com Mon Jul 9 19:16:10 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Jul 2007 17:16:10 -0700 Subject: [llvm-commits] [llvm] r38478 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td X86RegisterInfo.cpp In-Reply-To: <200707100005.l6A05w1A030461@zion.cs.uiuc.edu> References: <200707100005.l6A05w1A030461@zion.cs.uiuc.edu> Message-ID: <4DD21D2C-FFE9-4B98-A209-88694CC4AE68@apple.com> On Jul 9, 2007, at 5:05 PM, Dan Gohman wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=38478&view=rev > Log: > Define non-intrinsic instructions for vector min, max, sqrt, rsqrt, > and rcp, > in addition to the intrinsic forms. Add spill-folding entries for > these new > instructions, and for the scalar min and max instrinsic > instructions which > were missing. And add some preliminary ISelLowering code for using > the new > non-intrinsic vector sqrt instruction, and fneg and fabs. Nice. Testcase please :). What sort of code does this improve? -Chris From resistor at mac.com Mon Jul 9 19:27:23 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 00:27:23 -0000 Subject: [llvm-commits] [llvm] r38480 - /llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Message-ID: <200707100027.l6A0RNGi031093@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 19:27:22 2007 New Revision: 38480 URL: http://llvm.org/viewvc/llvm-project?rev=38480&view=rev Log: Move some key maps from std::map to DenseMap. This improves the time to optimize Anton's testcase from 17.5s to 15.7s. Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=38480&r1=38479&r2=38480&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Jul 9 19:27:22 2007 @@ -556,6 +556,10 @@ BitVector numbers; public: ValueNumberedSet() { numbers.resize(1); } + ValueNumberedSet(const ValueNumberedSet& other) { + numbers = other.numbers; + contents = other.contents; + } typedef SmallPtrSet::iterator iterator; @@ -614,9 +618,9 @@ ValueTable VN; std::vector createdExpressions; - std::map availableOut; - std::map anticipatedIn; - std::map generatedPhis; + DenseMap availableOut; + DenseMap anticipatedIn; + DenseMap generatedPhis; // This transformation requires dominator postdominator info virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -1175,7 +1179,7 @@ isa(BI) || isa(BI) || isa(BI) || isa(BI)) { - if (availableOut[BB].test(VN.lookup(BI)) && ! availableOut[BB].count(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(leader)) if (Instr->getParent() != 0 && Instr != BI) { From resistor at mac.com Mon Jul 9 21:01:16 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 02:01:16 -0000 Subject: [llvm-commits] [llvm] r38481 - /llvm/trunk/include/llvm/ADT/BitVector.h Message-ID: <200707100201.l6A21GNs001196@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 9 21:01:16 2007 New Revision: 38481 URL: http://llvm.org/viewvc/llvm-project?rev=38481&view=rev Log: Evidently my earlier fix did not go far enough. When resizing a zero-sized BitVector, make sure to set or clear ALL of the bits. Modified: llvm/trunk/include/llvm/ADT/BitVector.h Modified: llvm/trunk/include/llvm/ADT/BitVector.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/BitVector.h?rev=38481&r1=38480&r2=38481&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/BitVector.h (original) +++ llvm/trunk/include/llvm/ADT/BitVector.h Mon Jul 9 21:01:16 2007 @@ -188,7 +188,8 @@ // If we previously had no size, initialize the low word if (Size == 0) - Bits[0] = t; + for (unsigned i = 0; i < Capacity; ++i) + Bits[i] = 0 - (unsigned)t; Size = N; clear_unused_bits(); From alenhar2 at cs.uiuc.edu Mon Jul 9 21:48:50 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 10 Jul 2007 02:48:50 -0000 Subject: [llvm-commits] [llvm] r38482 - /llvm/branches/SVA/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200707100248.l6A2moUM002573@zion.cs.uiuc.edu> Author: alenhar2 Date: Mon Jul 9 21:48:50 2007 New Revision: 38482 URL: http://llvm.org/viewvc/llvm-project?rev=38482&view=rev Log: backport fix to SVA branch Modified: llvm/branches/SVA/lib/Transforms/IPO/GlobalOpt.cpp Modified: llvm/branches/SVA/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/SVA/lib/Transforms/IPO/GlobalOpt.cpp?rev=38482&r1=38481&r2=38482&view=diff ============================================================================== --- llvm/branches/SVA/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/branches/SVA/lib/Transforms/IPO/GlobalOpt.cpp Mon Jul 9 21:48:50 2007 @@ -616,7 +616,8 @@ Loads.push_back(LI); Changed |= OptimizeAwayTrappingUsesOfValue(LI, LV); } else { - assert(isa(*GUI) && "Only expect load and stores!"); + assert((isa(*GUI)|| isa(*GUI) || + isa(*GUI)) && "Only expect load and stores!"); } if (Changed) { From greened at obbligato.org Mon Jul 9 22:05:06 2007 From: greened at obbligato.org (David A. Greene) Date: Mon, 9 Jul 2007 22:05:06 -0500 Subject: [llvm-commits] REPOST: llvm-gcc expensive checks patch In-Reply-To: <66817935-B9DA-432B-9A47-961FDE272D66@apple.com> References: <200707061151.33902.greened@obbligato.org> <66817935-B9DA-432B-9A47-961FDE272D66@apple.com> Message-ID: <200707092205.06292.greened@obbligato.org> On Monday 09 July 2007 13:04, Chris Lattner wrote: > I applied it: > http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of- > Mon-20070709/051660.html Danke. > I think that "llvm-config --cppflags" should include "- > D__STDC_LIMIT_MACROS". What do you think? Yes, if that's what it's compiled with (don't have the sources handy ATM). > Also, please don't put markers like "Cray [dag]" into the files. Oops, forgot to remove those from the patch. I've got some more fixes coming, but will wait until llvm-gcc is in the main repository. -Dave From rspencer at reidspencer.com Mon Jul 9 22:27:16 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 09 Jul 2007 20:27:16 -0700 Subject: [llvm-commits] REPOST: llvm-gcc expensive checks patch In-Reply-To: <200707092205.06292.greened@obbligato.org> References: <200707061151.33902.greened@obbligato.org> <66817935-B9DA-432B-9A47-961FDE272D66@apple.com> <200707092205.06292.greened@obbligato.org> Message-ID: <1184038036.27071.410.camel@bashful.x10sys.com> On Mon, 2007-07-09 at 22:05 -0500, David A. Greene wrote: > On Monday 09 July 2007 13:04, Chris Lattner wrote: > > > I applied it: > > http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of- > > Mon-20070709/051660.html > > Danke. > > > I think that "llvm-config --cppflags" should include "- > > D__STDC_LIMIT_MACROS". What do you think? > > Yes, if that's what it's compiled with (don't have the sources > handy ATM). $ grep STDC_LIMIT Make* Makefile.rules:CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS Reid. > > > Also, please don't put markers like "Cray [dag]" into the files. > > Oops, forgot to remove those from the patch. > > I've got some more fixes coming, but will wait until llvm-gcc is in the > main repository. > > -Dave > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nicholas at mxc.ca Mon Jul 9 22:28:21 2007 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 10 Jul 2007 03:28:21 -0000 Subject: [llvm-commits] [llvm] r38483 - /llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Message-ID: <200707100328.l6A3SL0F003797@zion.cs.uiuc.edu> Author: nicholas Date: Mon Jul 9 22:28:21 2007 New Revision: 38483 URL: http://llvm.org/viewvc/llvm-project?rev=38483&view=rev Log: Update the ValueRanges interface to use value numbers instead of Value*s. Modified: llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Modified: llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp?rev=38483&r1=38482&r2=38483&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Mon Jul 9 22:28:21 2007 @@ -92,6 +92,7 @@ #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" @@ -393,6 +394,28 @@ 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(V1)) @@ -418,6 +441,9 @@ /// 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(V) || isa(V) || isa(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); @@ -429,15 +455,28 @@ 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(V) || isa(V) || isa(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()); - assert(!std::binary_search(VNMap.begin(), VNMap.end(), pair) && + 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(std::lower_bound(VNMap.begin(), VNMap.end(), pair), pair); + VNMap.insert(I, pair); return Values.size(); } @@ -489,7 +528,7 @@ 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 + else VNMap.insert(I, pair); // New Value // XXX: we currently don't have to worry about updating values with @@ -506,12 +545,12 @@ /// remove - removes all references to value V. void remove(Value *V) { - VNMapType::iterator B = VNMap.begin(); + VNMapType::iterator B = VNMap.begin(), E = VNMap.end(); VNPair pair(V, 0, DTDFS->getRootNode()); - VNMapType::iterator J = std::upper_bound(B, VNMap.end(), pair); + VNMapType::iterator J = std::upper_bound(B, E, pair); VNMapType::iterator I = J; - while (I != B && I->V == V) --I; + while (I != B && (I == E || I->V == V)) --I; VNMap.erase(I, J); } @@ -601,8 +640,7 @@ " !=", "000031" }; for (Node::const_iterator NI = begin(), NE = end(); NI != NE; ++NI) { os << names[NI->LV] << " " << NI->To - << " (" << NI->Subtree->getDFSNumIn() << ")"; - if (NI != NE) os << ", "; + << " (" << NI->Subtree->getDFSNumIn() << "), "; } } public: @@ -676,26 +714,14 @@ std::vector Nodes; public: - /// node - returns the node object at a given index retrieved from getNode. - /// Index zero is reserved and may not be passed in here. The pointer - /// returned is valid until the next call to newNode or getOrInsertNode. + /// 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(index != 0 && "Zero index is reserved for not found."); - assert(index <= Nodes.size() && "Index out of range."); + assert(VN.value(index)); // This triggers the necessary checks. + if (Nodes.size() < index) Nodes.resize(index); return &Nodes[index-1]; } - /// newNode - creates a new node for a given Value and returns the index. - unsigned newNode(Value *V) { - assert((isa(V) || isa(V) || isa(V)) && - "Bad Value for node."); - assert(V->getType() != Type::VoidTy && "Void node?"); - - unsigned n = VN.newVN(V); - if (Nodes.size() < n) Nodes.resize(n); - return n; - } - /// isRelatedBy - true iff n1 op n2 bool isRelatedBy(unsigned n1, unsigned n2, DomTreeDFS::Node *Subtree, LatticeVal LV) { @@ -721,9 +747,6 @@ assert(!isRelatedBy(n1, n2, Subtree, reversePredicate(LV1)) && "Contradictory inequality."); - Node *N1 = node(n1); - Node *N2 = node(n2); - // 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) { @@ -735,7 +758,7 @@ unsigned LV1_s = LV1 & (SLT_BIT|SGT_BIT); unsigned LV1_u = LV1 & (ULT_BIT|UGT_BIT); - for (Node::iterator I = N1->begin(), E = N1->end(); I != E; ++I) { + 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; @@ -766,13 +789,13 @@ LatticeVal NewLV = static_cast(new_relationship); node(I->To)->update(n2, NewLV, Local_Subtree); - N2->update(I->To, reversePredicate(NewLV), Local_Subtree); + node(n2)->update(I->To, reversePredicate(NewLV), Local_Subtree); } } } } - for (Node::iterator I = N2->begin(), E = N2->end(); I != E; ++I) { + 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)) @@ -801,7 +824,7 @@ LatticeVal NewLV = static_cast(new_relationship); - N1->update(I->To, NewLV, Local_Subtree); + node(n1)->update(I->To, NewLV, Local_Subtree); node(I->To)->update(n1, reversePredicate(NewLV), Local_Subtree); } } @@ -809,8 +832,8 @@ } } - N1->update(n2, LV1, Subtree); - N2->update(n1, reversePredicate(LV1), 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 @@ -848,101 +871,130 @@ /// ValueRanges tracks the known integer ranges and anti-ranges of the nodes /// in the InequalityGraph. class VISIBILITY_HIDDEN ValueRanges { + ValueNumbering &VN; + TargetData *TD; - /// A ScopedRange ties an InequalityGraph node with a ConstantRange under - /// the scope of a rooted subtree in the dominator tree. class VISIBILITY_HIDDEN ScopedRange { - public: - ScopedRange(Value *V, ConstantRange CR, DomTreeDFS::Node *ST) - : V(V), CR(CR), Subtree(ST) {} + typedef std::vector > + RangeListType; + RangeListType RangeList; + + static bool swo(const std::pair &LHS, + const std::pair &RHS) { + return *LHS.first < *RHS.first; + } - Value *V; - ConstantRange CR; - DomTreeDFS::Node *Subtree; + public: +#ifndef NDEBUG + virtual ~ScopedRange() {} + virtual void dump() const { + dump(*cerr.stream()); + } - bool operator<(const ScopedRange &range) const { - if (V != range.V) return V < range.V; - return *Subtree < *range.Subtree; + 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); - bool operator<(const Value *value) const { - return V < value; + while (I != E && !I->first->dominates(Subtree)) ++I; + return I; } - bool operator>(const Value *value) const { - return V > value; + 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; } - friend bool operator<(const Value *value, const ScopedRange &range) { - return range.operator>(value); + void update(const ConstantRange &CR, DomTreeDFS::Node *Subtree) { + assert(!CR.isEmptySet() && "Empty ConstantRange."); + assert(!CR.isSingleElement() && "Won't 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.intersectWith(CR); + assert(!CR2.isEmptySet() && !CR2.isSingleElement() && + "Invalid union of ranges."); + I->second = CR2; + } else + RangeList.insert(I, std::make_pair(Subtree, CR)); } }; - TargetData *TD; - std::vector Ranges; - typedef std::vector::iterator iterator; - // XXX: this is a copy of the code in InequalityGraph::Node. Perhaps a - // intrusive domtree-scoped container is in order? + 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); + } - iterator begin() { return Ranges.begin(); } - iterator end() { return Ranges.end(); } + /// 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."); - iterator find(Value *V, DomTreeDFS::Node *Subtree) { - iterator E = end(); - for (iterator I = std::lower_bound(begin(), E, V); - I != E && I->V == V; ++I) { - if (Subtree->DominatedBy(I->Subtree)) - return I; - } - return E; - } + if (LV == NE) + return makeConstantRange(ICmpInst::ICMP_NE, CR); - void update(Value *V, ConstantRange CR, DomTreeDFS::Node *Subtree) { - assert(!CR.isEmptySet() && "Empty ConstantRange!"); - if (CR.isFullSet()) return; + unsigned LV_s = LV & (SGT_BIT|SLT_BIT); + unsigned LV_u = LV & (UGT_BIT|ULT_BIT); + bool hasEQ = LV & EQ_BIT; - iterator I = find(V, Subtree); - if (I == end()) { - ScopedRange range(V, CR, Subtree); - iterator Insert = std::lower_bound(begin(), end(), range); - Ranges.insert(Insert, range); - } else { - CR = CR.intersectWith(I->CR); - assert(!CR.isEmptySet() && "Empty intersection of ConstantRanges!"); + ConstantRange Range(CR.getBitWidth()); - if (CR != I->CR) { - if (Subtree != I->Subtree) { - assert(Subtree->DominatedBy(I->Subtree) && - "Find returned subtree that doesn't apply."); - - ScopedRange range(V, CR, Subtree); - iterator Insert = std::lower_bound(begin(), end(), range); - Ranges.insert(Insert, range); // invalidates I - I = find(V, Subtree); - } + if (LV_s == SGT_BIT) { + Range = Range.intersectWith(makeConstantRange( + hasEQ ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_SGT, CR)); + } else if (LV_s == SLT_BIT) { + Range = Range.intersectWith(makeConstantRange( + hasEQ ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_SLT, CR)); + } - // Also, we have to tighten any edge that Subtree dominates. - for (iterator B = begin(); I->V == V; --I) { - if (I->Subtree->DominatedBy(Subtree)) { - I->CR = CR.intersectWith(I->CR); - assert(!I->CR.isEmptySet() && - "Empty intersection of ConstantRanges!"); - } - if (I == B) break; - } - } + if (LV_u == UGT_BIT) { + Range = Range.intersectWith(makeConstantRange( + hasEQ ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_UGT, CR)); + } else if (LV_u == ULT_BIT) { + Range = Range.intersectWith(makeConstantRange( + hasEQ ? ICmpInst::ICMP_ULE : ICmpInst::ICMP_ULT, CR)); } + + return Range; } - /// range - Creates a ConstantRange representing the set of all values - /// that match the ICmpInst::Predicate with any of the values in CR. - ConstantRange range(ICmpInst::Predicate ICmpOpcode, - const ConstantRange &CR) { + /// 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 range()"); + default: assert(!"Invalid ICmp opcode to makeConstantRange()"); case ICmpInst::ICMP_EQ: return ConstantRange(CR.getLower(), CR.getUpper()); case ICmpInst::ICMP_NE: @@ -985,63 +1037,54 @@ } } - /// 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."); +#ifndef NDEBUG + bool isCanonical(Value *V, DomTreeDFS::Node *Subtree) { + return V == VN.canonicalize(V, Subtree); + } +#endif - if (LV == NE) - return range(ICmpInst::ICMP_NE, CR); + public: - unsigned LV_s = LV & (SGT_BIT|SLT_BIT); - unsigned LV_u = LV & (UGT_BIT|ULT_BIT); - bool hasEQ = LV & EQ_BIT; + ValueRanges(ValueNumbering &VN, TargetData *TD) : VN(VN), TD(TD) {} - ConstantRange Range(CR.getBitWidth()); +#ifndef NDEBUG + virtual ~ValueRanges() {} - if (LV_s == SGT_BIT) { - Range = Range.intersectWith(range( - hasEQ ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_SGT, CR)); - } else if (LV_s == SLT_BIT) { - Range = Range.intersectWith(range( - hasEQ ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_SLT, CR)); - } + virtual void dump() const { + dump(*cerr.stream()); + } - if (LV_u == UGT_BIT) { - Range = Range.intersectWith(range( - hasEQ ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_UGT, CR)); - } else if (LV_u == ULT_BIT) { - Range = Range.intersectWith(range( - hasEQ ? ICmpInst::ICMP_ULE : ICmpInst::ICMP_ULT, CR)); + 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"; } - - return Range; } - -#ifndef NDEBUG - bool isCanonical(Value *V, DomTreeDFS::Node *Subtree, VRPSolver *VRP); #endif - public: + /// 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; + } - explicit ValueRanges(TargetData *TD) : TD(TD) {} + Value *V = VN.value(n); + ConstantRange CR = range(V); + return CR; + } - // rangeFromValue - converts a Value into a range. If the value is a - // constant it constructs the single element range, otherwise it performs - // a lookup. The width W must be retrieved from typeToWidth and may not - // be zero. - ConstantRange rangeFromValue(Value *V, DomTreeDFS::Node *Subtree, - uint32_t W) { - if (ConstantInt *C = dyn_cast(V)) { + /// range - determine a range from a Value without performing any lookups. + ConstantRange range(Value *V) const { + if (ConstantInt *C = dyn_cast(V)) return ConstantRange(C->getValue()); - } else if (isa(V)) { - return ConstantRange(APInt::getNullValue(W)); - } else { - iterator I = find(V, Subtree); - if (I != end()) - return I->CR; - } - return ConstantRange(W); + else if (isa(V)) + return ConstantRange(APInt::getNullValue(typeToWidth(V->getType()))); + else + return typeToWidth(V->getType()); } // typeToWidth - returns the number of bits necessary to store a value of @@ -1056,15 +1099,8 @@ return 0; } - bool isRelatedBy(Value *V1, Value *V2, DomTreeDFS::Node *Subtree, - LatticeVal LV) { - uint32_t W = typeToWidth(V1->getType()); - if (!W) return false; - - ConstantRange CR1 = rangeFromValue(V1, Subtree, W); - ConstantRange CR2 = rangeFromValue(V2, Subtree, W); - - // True iff all values in CR1 are LV to all values in CR2. + static bool isRelatedBy(const ConstantRange &CR1, const ConstantRange &CR2, + LatticeVal LV) { switch (LV) { default: assert(!"Impossible lattice value!"); case NE: @@ -1112,22 +1148,27 @@ } } + 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, Value *New, + void mergeInto(Value **I, unsigned n, unsigned New, DomTreeDFS::Node *Subtree, VRPSolver *VRP) { - assert(isCanonical(New, Subtree, VRP) && "Best choice not canonical?"); - - uint32_t W = typeToWidth(New->getType()); - if (!W) return; - - ConstantRange CR_New = rangeFromValue(New, Subtree, W); + ConstantRange CR_New = range(New, Subtree); ConstantRange Merged = CR_New; for (; n != 0; ++I, --n) { - ConstantRange CR_Kill = rangeFromValue(*I, Subtree, W); + unsigned i = VN.valueNumber(*I, Subtree); + ConstantRange CR_Kill = i ? range(i, Subtree) : range(*I); if (CR_Kill.isFullSet()) continue; Merged = Merged.intersectWith(CR_Kill); } @@ -1137,11 +1178,16 @@ applyRange(New, Merged, Subtree, VRP); } - void applyRange(Value *V, const ConstantRange &CR, + void applyRange(unsigned n, const ConstantRange &CR, DomTreeDFS::Node *Subtree, VRPSolver *VRP) { - assert(isCanonical(V, Subtree, VRP) && "Value not canonical."); + ConstantRange Merged = CR.intersectWith(range(n, Subtree)); + if (Merged.isEmptySet()) { + markBlock(VRP); + return; + } - if (const APInt *I = CR.getSingleElement()) { + 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); @@ -1149,33 +1195,25 @@ } else if (const PointerType *PTy = dyn_cast(Ty)) { assert(*I == 0 && "Pointer is null but not zero?"); addToWorklist(V, ConstantPointerNull::get(PTy), - ICmpInst::ICMP_EQ, VRP); + ICmpInst::ICMP_EQ, VRP); return; } } - ConstantRange Merged = CR.intersectWith( - rangeFromValue(V, Subtree, CR.getBitWidth())); - if (Merged.isEmptySet()) { - markBlock(VRP); - return; - } - - update(V, Merged, Subtree); + update(n, Merged, Subtree); } - void addNotEquals(Value *V1, Value *V2, DomTreeDFS::Node *Subtree, + void addNotEquals(unsigned n1, unsigned n2, DomTreeDFS::Node *Subtree, VRPSolver *VRP) { - uint32_t W = typeToWidth(V1->getType()); - if (!W) return; + ConstantRange CR1 = range(n1, Subtree); + ConstantRange CR2 = range(n2, Subtree); - ConstantRange CR1 = rangeFromValue(V1, Subtree, W); - ConstantRange CR2 = rangeFromValue(V2, Subtree, W); + uint32_t W = CR1.getBitWidth(); if (const APInt *I = CR1.getSingleElement()) { if (CR2.isFullSet()) { ConstantRange NewCR2(CR1.getUpper(), CR1.getLower()); - applyRange(V2, NewCR2, Subtree, VRP); + applyRange(n2, NewCR2, Subtree, VRP); } else if (*I == CR2.getLower()) { APInt NewLower(CR2.getLower() + 1), NewUpper(CR2.getUpper()); @@ -1183,7 +1221,7 @@ NewLower = NewUpper = APInt::getMinValue(W); ConstantRange NewCR2(NewLower, NewUpper); - applyRange(V2, NewCR2, Subtree, VRP); + applyRange(n2, NewCR2, Subtree, VRP); } else if (*I == CR2.getUpper() - 1) { APInt NewLower(CR2.getLower()), NewUpper(CR2.getUpper() - 1); @@ -1191,14 +1229,14 @@ NewLower = NewUpper = APInt::getMinValue(W); ConstantRange NewCR2(NewLower, NewUpper); - applyRange(V2, NewCR2, Subtree, VRP); + applyRange(n2, NewCR2, Subtree, VRP); } } if (const APInt *I = CR2.getSingleElement()) { if (CR1.isFullSet()) { ConstantRange NewCR1(CR2.getUpper(), CR2.getLower()); - applyRange(V1, NewCR1, Subtree, VRP); + applyRange(n1, NewCR1, Subtree, VRP); } else if (*I == CR1.getLower()) { APInt NewLower(CR1.getLower() + 1), NewUpper(CR1.getUpper()); @@ -1206,7 +1244,7 @@ NewLower = NewUpper = APInt::getMinValue(W); ConstantRange NewCR1(NewLower, NewUpper); - applyRange(V1, NewCR1, Subtree, VRP); + applyRange(n1, NewCR1, Subtree, VRP); } else if (*I == CR1.getUpper() - 1) { APInt NewLower(CR1.getLower()), NewUpper(CR1.getUpper() - 1); @@ -1214,40 +1252,34 @@ NewLower = NewUpper = APInt::getMinValue(W); ConstantRange NewCR1(NewLower, NewUpper); - applyRange(V1, NewCR1, Subtree, VRP); + applyRange(n1, NewCR1, Subtree, VRP); } } } - void addInequality(Value *V1, Value *V2, DomTreeDFS::Node *Subtree, + void addInequality(unsigned n1, unsigned n2, DomTreeDFS::Node *Subtree, LatticeVal LV, VRPSolver *VRP) { - assert(!isRelatedBy(V1, V2, Subtree, LV) && "Asked to do useless work."); - - assert(isCanonical(V1, Subtree, VRP) && "Value not canonical."); - assert(isCanonical(V2, Subtree, VRP) && "Value not canonical."); + assert(!isRelatedBy(n1, n2, Subtree, LV) && "Asked to do useless work."); if (LV == NE) { - addNotEquals(V1, V2, Subtree, VRP); + addNotEquals(n1, n2, Subtree, VRP); return; } - uint32_t W = typeToWidth(V1->getType()); - if (!W) return; - - ConstantRange CR1 = rangeFromValue(V1, Subtree, W); - ConstantRange CR2 = rangeFromValue(V2, Subtree, W); + ConstantRange CR1 = range(n1, Subtree); + ConstantRange CR2 = range(n2, Subtree); if (!CR1.isSingleElement()) { ConstantRange NewCR1 = CR1.intersectWith(create(LV, CR2)); if (NewCR1 != CR1) - applyRange(V1, NewCR1, Subtree, VRP); + applyRange(n1, NewCR1, Subtree, VRP); } if (!CR2.isSingleElement()) { ConstantRange NewCR2 = CR2.intersectWith(create(reversePredicate(LV), CR1)); if (NewCR2 != CR2) - applyRange(V2, NewCR2, Subtree, VRP); + applyRange(n2, NewCR2, Subtree, VRP); } } }; @@ -1406,19 +1438,18 @@ // 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 *N1 = IG.node(n1); - Node *N2 = IG.node(n2); - Node::iterator end = N2->end(); + 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 = N1->begin(), E = N1->end(); I != E; ++I) { + 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 = N2->find(I->To, Top); + 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); @@ -1518,7 +1549,7 @@ if (!isa(V1)) { if (Remove.empty()) { - VR.mergeInto(&V2, 1, V1, Top, this); + VR.mergeInto(&V2, 1, VN.getOrInsertVN(V1, Top), Top, this); } else { std::vector RemoveVals; RemoveVals.reserve(Remove.size()); @@ -1529,21 +1560,21 @@ if (!V->use_empty()) RemoveVals.push_back(V); } - VR.mergeInto(&RemoveVals[0], RemoveVals.size(), V1, Top, this); + VR.mergeInto(&RemoveVals[0], RemoveVals.size(), + VN.getOrInsertVN(V1, Top), Top, this); } } if (mergeIGNode) { // Create N1. - if (!n1) n1 = IG.newNode(V1); + if (!n1) n1 = VN.getOrInsertVN(V1, Top); // Migrate relationships from removed nodes to N1. - Node *N1 = IG.node(n1); for (SetVector::iterator I = Remove.begin(), E = Remove.end(); I != E; ++I) { unsigned n = *I; - Node *N = IG.node(n); - for (Node::iterator NI = N->begin(), NE = N->end(); NI != NE; ++NI) { + 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."); @@ -1553,7 +1584,7 @@ continue; IG.node(NI->To)->update(n1, reversePredicate(NI->LV), Top); - N1->update(NI->To, NI->LV, Top); + IG.node(n1)->update(NI->To, NI->LV, Top); } } } @@ -1679,19 +1710,33 @@ return ConstantExpr::getCompare(Pred, C1, C2) == ConstantInt::getTrue(); - if (unsigned n1 = VN.valueNumber(V1, Top)) - if (unsigned n2 = VN.valueNumber(V2, Top)) { - 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; - } + 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(V2)) || + (n2 && !n1 && isa(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 VR.isRelatedBy(V1, V2, Top, cmpInstToLattice(Pred)); + return false; } /// add - adds a new property to the work queue @@ -1817,10 +1862,10 @@ } else if (CastInst *CI = dyn_cast(I)) { const Type *SrcTy = CI->getSrcTy(); - Value *TheCI = VN.canonicalize(CI, Top); + unsigned ci = VN.getOrInsertVN(CI, Top); uint32_t W = VR.typeToWidth(SrcTy); if (!W) return; - ConstantRange CR = VR.rangeFromValue(TheCI, Top, W); + ConstantRange CR = VR.range(ci, Top); if (CR.isFullSet()) return; @@ -1828,11 +1873,11 @@ default: break; case Instruction::ZExt: case Instruction::SExt: - VR.applyRange(VN.canonicalize(CI->getOperand(0), Top), + VR.applyRange(VN.getOrInsertVN(CI->getOperand(0), Top), CR.truncate(W), Top, this); break; case Instruction::BitCast: - VR.applyRange(VN.canonicalize(CI->getOperand(0), Top), + VR.applyRange(VN.getOrInsertVN(CI->getOperand(0), Top), CR, Top, this); break; } @@ -1956,11 +2001,10 @@ Value *Op1 = VN.canonicalize(IC->getOperand(1), Top); ICmpInst::Predicate Pred = IC->getPredicate(); - if (isRelatedBy(Op0, Op1, Pred)) { + if (isRelatedBy(Op0, Op1, Pred)) add(IC, ConstantInt::getTrue(), ICmpInst::ICMP_EQ, NewContext); - } else if (isRelatedBy(Op0, Op1, ICmpInst::getInversePredicate(Pred))) { + else if (isRelatedBy(Op0, Op1, ICmpInst::getInversePredicate(Pred))) add(IC, ConstantInt::getFalse(), ICmpInst::ICMP_EQ, NewContext); - } } else if (SelectInst *SI = dyn_cast(I)) { if (I->getType()->isFPOrFPVector()) return; @@ -1992,25 +2036,25 @@ } uint32_t W = VR.typeToWidth(DestTy); - Value *TheCI = VN.canonicalize(CI, Top); - ConstantRange CR = VR.rangeFromValue(Op, Top, W); + 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(TheCI, CR.zeroExtend(W), Top, this); + VR.applyRange(ci, CR.zeroExtend(W), Top, this); break; case Instruction::SExt: - VR.applyRange(TheCI, CR.signExtend(W), Top, this); + VR.applyRange(ci, CR.signExtend(W), Top, this); break; case Instruction::Trunc: { ConstantRange Result = CR.truncate(W); if (!Result.isFullSet()) - VR.applyRange(TheCI, Result, Top, this); + VR.applyRange(ci, Result, Top, this); } break; case Instruction::BitCast: - VR.applyRange(TheCI, CR, Top, this); + VR.applyRange(ci, CR, Top, this); break; // TODO: other casts? } @@ -2054,7 +2098,9 @@ 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. @@ -2091,10 +2137,10 @@ continue; } - unsigned n1 = VN.valueNumber(O.LHS, Top); - unsigned n2 = VN.valueNumber(O.RHS, Top); + unsigned n1 = VN.getOrInsertVN(O.LHS, Top); + unsigned n2 = VN.getOrInsertVN(O.RHS, Top); - if (n1 && n1 == n2) { + 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); @@ -2103,19 +2149,16 @@ continue; } - if (VR.isRelatedBy(O.LHS, O.RHS, Top, LV) || - (n1 && n2 && IG.isRelatedBy(n1, n2, Top, LV))) { + if (VR.isRelatedBy(n1, n2, Top, LV) || + IG.isRelatedBy(n1, n2, Top, LV)) { WorkList.pop_front(); continue; } - VR.addInequality(O.LHS, O.RHS, Top, LV, this); + VR.addInequality(n1, n2, Top, LV, this); if ((!isa(O.RHS) && !isa(O.LHS)) || - LV == NE) { - if (!n1) n1 = IG.newNode(O.LHS); - if (!n2) n2 = IG.newNode(O.RHS); + LV == NE) IG.addInequality(n1, n2, Top, LV); - } if (Instruction *I1 = dyn_cast(O.LHS)) { if (aboveOrBelow(I1)) @@ -2163,13 +2206,6 @@ VRP->UB.mark(VRP->TopBB); } -#ifndef NDEBUG - bool ValueRanges::isCanonical(Value *V, DomTreeDFS::Node *Subtree, - VRPSolver *VRP) { - return V == VRP->VN.canonicalize(V, Subtree); - } -#endif - /// 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. @@ -2262,7 +2298,9 @@ // the PropertySet. 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)) { @@ -2325,7 +2363,7 @@ DomTreeDFS::Node *Root = DTDFS->getRootNode(); VN = new ValueNumbering(DTDFS); IG = new InequalityGraph(*VN, Root); - VR = new ValueRanges(TD); + VR = new ValueRanges(*VN, TD); WorkList.push_back(Root); do { @@ -2373,13 +2411,17 @@ 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); From clattner at apple.com Tue Jul 10 01:45:03 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Jul 2007 23:45:03 -0700 Subject: [llvm-commits] REPOST: llvm-gcc expensive checks patch In-Reply-To: <1184038036.27071.410.camel@bashful.x10sys.com> References: <200707061151.33902.greened@obbligato.org> <66817935-B9DA-432B-9A47-961FDE272D66@apple.com> <200707092205.06292.greened@obbligato.org> <1184038036.27071.410.camel@bashful.x10sys.com> Message-ID: On Jul 9, 2007, at 8:27 PM, Reid Spencer wrote: > On Mon, 2007-07-09 at 22:05 -0500, David A. Greene wrote: >> On Monday 09 July 2007 13:04, Chris Lattner wrote: >> >>> I applied it: >>> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of- >>> Mon-20070709/051660.html >> >> Danke. >> >>> I think that "llvm-config --cppflags" should include "- >>> D__STDC_LIMIT_MACROS". What do you think? >> >> Yes, if that's what it's compiled with (don't have the sources >> handy ATM). > > $ grep STDC_LIMIT Make* > Makefile.rules:CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS Neither of those are currently included in --cppflags. These aren't things that are configured, they are things required to build LLVM headers. -Chris From evan.cheng at apple.com Tue Jul 10 01:59:55 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 06:59:55 -0000 Subject: [llvm-commits] [llvm] r38484 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200707100659.l6A6xtND012957@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 01:59:55 2007 New Revision: 38484 URL: http://llvm.org/viewvc/llvm-project?rev=38484&view=rev Log: Move DenseMapKeyInfo from LegalizeDAG.cpp to SelectionDAGNodes.h Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=38484&r1=38483&r2=38484&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Jul 10 01:59:55 2007 @@ -34,6 +34,7 @@ class MachineBasicBlock; class MachineConstantPoolValue; class SDNode; +template struct DenseMapKeyInfo; template struct simplify_type; template struct ilist_traits; template class iplist; @@ -728,6 +729,16 @@ }; +template<> struct DenseMapKeyInfo { + 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 isPod() { return true; } +}; + /// simplify_type specializations - Allow casting operators to work directly on /// SDOperands as if they were SDNode*'s. template<> struct simplify_type { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=38484&r1=38483&r2=38484&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jul 10 01:59:55 2007 @@ -39,18 +39,6 @@ static const bool ViewLegalizeDAGs = 0; #endif -namespace llvm { -template<> -struct DenseMapKeyInfo { - 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 DenseMapKeyInfo::getHashValue(Val.Val) + Val.ResNo; - } - static bool isPod() { return true; } -}; -} - //===----------------------------------------------------------------------===// /// SelectionDAGLegalize - This takes an arbitrary SelectionDAG as input and /// hacks on it until the target machine can handle it. This involves From evan.cheng at apple.com Tue Jul 10 02:08:32 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 07:08:32 -0000 Subject: [llvm-commits] [llvm] r38485 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Message-ID: <200707100708.l6A78Wa1013187@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 02:08:32 2007 New Revision: 38485 URL: http://llvm.org/viewvc/llvm-project?rev=38485&view=rev Log: When a node value is only used by a CopyToReg, use the user's dest. This should not be restricted to nodes that produce only a single value. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=38485&r1=38484&r2=38485&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Tue Jul 10 02:08:32 2007 @@ -240,7 +240,7 @@ /// VRBaseMap contains, for each already emitted node, the first virtual /// register number for the results of the node. /// - void EmitNode(SDNode *Node, DenseMap &VRBaseMap); + void EmitNode(SDNode *Node, DenseMap &VRBaseMap); /// EmitNoop - Emit a noop instruction. /// @@ -257,7 +257,7 @@ private: void AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum, const TargetInstrDescriptor *II, - DenseMap &VRBaseMap); + DenseMap &VRBaseMap); }; /// createBFS_DAGScheduler - This creates a simple breadth first instruction Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=38485&r1=38484&r2=38485&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Tue Jul 10 02:08:32 2007 @@ -254,31 +254,54 @@ ? TII->getPointerRegClass() : MRI->getRegClass(toi.RegClass); } -static unsigned CreateVirtualRegisters(const MRegisterInfo *MRI, - MachineInstr *MI, - unsigned NumResults, - SSARegMap *RegMap, - const TargetInstrInfo *TII, - const TargetInstrDescriptor &II) { - // Create the result registers for this node and add the result regs to - // the machine instruction. - unsigned ResultReg = - RegMap->createVirtualRegister(getInstrOperandRegClass(MRI, TII, &II, 0)); - MI->addRegOperand(ResultReg, true); - for (unsigned i = 1; i != NumResults; ++i) { - const TargetRegisterClass *RC = getInstrOperandRegClass(MRI, TII, &II, i); - assert(RC && "Isn't a register operand!"); - MI->addRegOperand(RegMap->createVirtualRegister(RC), true); +static void CreateVirtualRegisters(SDNode *Node, + unsigned NumResults, + const MRegisterInfo *MRI, + MachineInstr *MI, + SSARegMap *RegMap, + const TargetInstrInfo *TII, + const TargetInstrDescriptor &II, + DenseMap &VRBaseMap) { + for (unsigned i = 0; i < NumResults; ++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; + if (Use->getOpcode() == ISD::CopyToReg && + Use->getOperand(2).Val == Node && + Use->getOperand(2).ResNo == i) { + unsigned Reg = cast(Use->getOperand(1))->getReg(); + if (MRegisterInfo::isVirtualRegister(Reg)) { + VRBase = Reg; + MI->addRegOperand(Reg, true); + break; + } + } + } + + if (VRBase == 0) { + // Create the result registers for this node and add the result regs to + // the machine instruction. + const TargetRegisterClass *RC = getInstrOperandRegClass(MRI, TII, &II, i); + assert(RC && "Isn't a register operand!"); + VRBase = RegMap->createVirtualRegister(RC); + MI->addRegOperand(VRBase, true); + } + + bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,i), VRBase)); + assert(isNew && "Node emitted out of order - early"); } - return ResultReg; } /// getVR - Return the virtual register corresponding to the specified result /// of the specified node. -static unsigned getVR(SDOperand Op, DenseMap &VRBaseMap) { - DenseMap::iterator I = VRBaseMap.find(Op.Val); +static unsigned getVR(SDOperand Op, DenseMap &VRBaseMap) { + DenseMap::iterator I = VRBaseMap.find(Op); assert(I != VRBaseMap.end() && "Node emitted out of order - late"); - return I->second + Op.ResNo; + return I->second; } @@ -289,7 +312,7 @@ void ScheduleDAG::AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum, const TargetInstrDescriptor *II, - DenseMap &VRBaseMap) { + DenseMap &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 @@ -406,9 +429,7 @@ /// EmitNode - Generate machine code for an node and needed dependencies. /// void ScheduleDAG::EmitNode(SDNode *Node, - DenseMap &VRBaseMap) { - unsigned VRBase = 0; // First virtual register for node - + DenseMap &VRBaseMap) { // If machine instruction if (Node->isTargetOpcode()) { unsigned Opc = Node->getTargetOpcode(); @@ -428,28 +449,9 @@ // Add result register values for things that are defined by this // instruction. - - // 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. - if (NumResults == 1) { - for (SDNode::use_iterator UI = Node->use_begin(), E = Node->use_end(); - UI != E; ++UI) { - SDNode *Use = *UI; - if (Use->getOpcode() == ISD::CopyToReg && - Use->getOperand(2).Val == Node) { - unsigned Reg = cast(Use->getOperand(1))->getReg(); - if (MRegisterInfo::isVirtualRegister(Reg)) { - VRBase = Reg; - MI->addRegOperand(Reg, true); - break; - } - } - } - } - - // Otherwise, create new virtual registers. - if (NumResults && VRBase == 0) - VRBase = CreateVirtualRegisters(MRI, MI, NumResults, RegMap, TII, II); + if (NumResults) + CreateVirtualRegisters(Node, NumResults, MRI, MI, RegMap, + TII, II, VRBaseMap); // Emit all of the actual operands of this instruction, adding them to the // instruction as appropriate. @@ -510,9 +512,12 @@ break; } case ISD::CopyFromReg: { + unsigned VRBase = 0; unsigned SrcReg = cast(Node->getOperand(1))->getReg(); if (MRegisterInfo::isVirtualRegister(SrcReg)) { - VRBase = SrcReg; // Just use the input register directly! + // Just use the input register directly! + bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,0),SrcReg)); + assert(isNew && "Node emitted out of order - early"); break; } @@ -542,6 +547,9 @@ VRBase = RegMap->createVirtualRegister(TRC); } MRI->copyRegToReg(*BB, BB->end(), VRBase, SrcReg, TRC); + + bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,0), VRBase)); + assert(isNew && "Node emitted out of order - early"); break; } case ISD::INLINEASM: { @@ -604,9 +612,6 @@ } } } - - assert(!VRBaseMap.count(Node) && "Node emitted out of order - early"); - VRBaseMap[Node] = VRBase; } void ScheduleDAG::EmitNoop() { @@ -629,7 +634,7 @@ // Finally, emit the code for all of the scheduled instructions. - DenseMap VRBaseMap; + DenseMap VRBaseMap; for (unsigned i = 0, e = Sequence.size(); i != e; i++) { if (SUnit *SU = Sequence[i]) { for (unsigned j = 0, ee = SU->FlaggedNodes.size(); j != ee; j++) Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp?rev=38485&r1=38484&r2=38485&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Tue Jul 10 02:08:32 2007 @@ -682,7 +682,7 @@ LI->first, RegMap->getRegClass(LI->second)); } - DenseMap VRBaseMap; + DenseMap VRBaseMap; // For each node in the ordering for (unsigned i = 0, N = Ordering.size(); i < N; i++) { From rspencer at reidspencer.com Tue Jul 10 02:14:08 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 10 Jul 2007 00:14:08 -0700 Subject: [llvm-commits] REPOST: llvm-gcc expensive checks patch In-Reply-To: References: <200707061151.33902.greened@obbligato.org> <66817935-B9DA-432B-9A47-961FDE272D66@apple.com> <200707092205.06292.greened@obbligato.org> <1184038036.27071.410.camel@bashful.x10sys.com> Message-ID: <1184051648.27071.434.camel@bashful.x10sys.com> On Mon, 2007-07-09 at 23:45 -0700, Chris Lattner wrote: > On Jul 9, 2007, at 8:27 PM, Reid Spencer wrote: > > > On Mon, 2007-07-09 at 22:05 -0500, David A. Greene wrote: > >> On Monday 09 July 2007 13:04, Chris Lattner wrote: > >> > >>> I applied it: > >>> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of- > >>> Mon-20070709/051660.html > >> > >> Danke. > >> > >>> I think that "llvm-config --cppflags" should include "- > >>> D__STDC_LIMIT_MACROS". What do you think? > >> > >> Yes, if that's what it's compiled with (don't have the sources > >> handy ATM). > > > > $ grep STDC_LIMIT Make* > > Makefile.rules:CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS > > Neither of those are currently included in --cppflags. These aren't > things that are configured, they are things required to build LLVM > headers. I was merely trying to answer the question "if that's what its compiled with" showing you that, yes, that is what its compiled with. In any event, I'm prepare a patch for this .. seems there was some confusion in the makefile variable names. > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Tue Jul 10 02:19:55 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Jul 2007 07:19:55 -0000 Subject: [llvm-commits] [llvm] r38486 - /llvm/trunk/Makefile.rules Message-ID: <200707100719.l6A7Jtnm013486@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 02:19:53 2007 New Revision: 38486 URL: http://llvm.org/viewvc/llvm-project?rev=38486&view=rev Log: Make sure that preprocessor symbols like _DEBUG, NDEBUG, and _GLIBC_DEBUG are put into the CPP.Defines variable. Seems the convention was corrupted with various changes made. It is important to get command line parameters into the right variable because things like llvm-config and sub-makefiles depend on it. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=38486&r1=38485&r2=38486&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Jul 10 02:19:53 2007 @@ -199,6 +199,7 @@ # 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) @@ -253,11 +254,9 @@ # then disable assertions by defining the appropriate preprocessor symbols. ifdef DISABLE_ASSERTIONS BuildMode := $(BuildMode)-Asserts - CXX.Flags += -DNDEBUG - C.Flags += -DNDEBUG + CPP.Defines += -DNDEBUG else - CXX.Flags += -D_DEBUG - C.Flags += -D_DEBUG + CPP.Defines += -D_DEBUG endif # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or @@ -265,7 +264,7 @@ # appropriate preprocessor symbols. ifdef ENABLE_EXPENSIVE_CHECKS BuildMode := $(BuildMode)+Checks - CXX.Flags += -D_GLIBCXX_DEBUG + CPP.Defines += -D_GLIBCXX_DEBUG endif ifeq ($(ENABLE_PIC),1) From reid at x10sys.com Tue Jul 10 02:21:34 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Jul 2007 07:21:34 -0000 Subject: [llvm-commits] [llvm] r38487 - /llvm/trunk/tools/llvm-config/Makefile Message-ID: <200707100721.l6A7LYgB013539@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 02:21:34 2007 New Revision: 38487 URL: http://llvm.org/viewvc/llvm-project?rev=38487&view=rev Log: Makesure the -cppflags also uses the CPP.BaseFlags as the CPP.Defines only contains some of the defines but not all CPP flags. Modified: llvm/trunk/tools/llvm-config/Makefile Modified: llvm/trunk/tools/llvm-config/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/Makefile?rev=38487&r1=38486&r2=38487&view=diff ============================================================================== --- llvm/trunk/tools/llvm-config/Makefile (original) +++ llvm/trunk/tools/llvm-config/Makefile Tue Jul 10 02:21:34 2007 @@ -20,8 +20,8 @@ ifeq ($(HAVE_PERL),1) # Combine preprocessor flags (except for -I) and CXX flags. -SUB_CPPFLAGS = ${CPP.Defines} -SUB_CFLAGS = ${CPP.BaseFlags} ${C.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: From reid at x10sys.com Tue Jul 10 02:48:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Jul 2007 07:48:09 -0000 Subject: [llvm-commits] [llvm] r38488 - /llvm/trunk/tools/llvm-config/llvm-config.in.in Message-ID: <200707100748.l6A7mAp4014273@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 02:48:09 2007 New Revision: 38488 URL: http://llvm.org/viewvc/llvm-project?rev=38488&view=rev Log: Simplify the handling of the --*flags options. The makefile already gets it right so there is no need to duplicate logic, just use the values the makefile provides. Eliminate some redundnt -D options from the output. Fix the help output so it fits on 80 cols. Modified: llvm/trunk/tools/llvm-config/llvm-config.in.in Modified: llvm/trunk/tools/llvm-config/llvm-config.in.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/llvm-config.in.in?rev=38488&r1=38487&r2=38488&view=diff ============================================================================== --- llvm/trunk/tools/llvm-config/llvm-config.in.in (original) +++ llvm/trunk/tools/llvm-config/llvm-config.in.in Tue Jul 10 02:48:09 2007 @@ -42,7 +42,6 @@ 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@}; -my $EXPENSIVE_CHECKS = q{@EXPENSIVE_CHECKS@}; #---- end autoconf values ---- # Must pretend x86_64 architecture is really x86, otherwise the native backend @@ -115,17 +114,11 @@ } elsif ($arg eq "--libdir") { $has_opt = 1; print "$LIBDIR\n"; } elsif ($arg eq "--cppflags") { - $has_opt = 1; - my $cppopts = get_cpp_opts(); - print "$cppopts\n"; + $has_opt = 1; print "-I$INCLUDEDIR $CPPFLAGS\n"; } elsif ($arg eq "--cflags") { - $has_opt = 1; - my $cppopts = get_cpp_opts(); - print "$cppopts $CFLAGS\n"; + $has_opt = 1; print "-I$INCLUDEDIR $CFLAGS\n"; } elsif ($arg eq "--cxxflags") { - $has_opt = 1; - my $cppopts = get_cpp_opts(); - print "$cppopts $CXXFLAGS\n"; + $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") { @@ -190,46 +183,32 @@ 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). + --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. + 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); } -# Return cpp flags used to build llvm. -sub get_cpp_opts { - my $opts = ""; - - if ($EXPENSIVE_CHECKS eq "yes") { - $opts = "-D_GLIBCXX_DEBUG -I$INCLUDEDIR $CPPFLAGS"; - } - else { - $opts = "-I$INCLUDEDIR $CPPFLAGS"; - } - - return $opts; -} - # Use -lfoo instead of libfoo.a whenever possible, and add directories to # files which can't be found using -L. sub fix_library_names (@) { From rspencer at reidspencer.com Tue Jul 10 02:50:26 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 10 Jul 2007 00:50:26 -0700 Subject: [llvm-commits] REPOST: llvm-gcc expensive checks patch In-Reply-To: <66817935-B9DA-432B-9A47-961FDE272D66@apple.com> References: <200707061151.33902.greened@obbligato.org> <66817935-B9DA-432B-9A47-961FDE272D66@apple.com> Message-ID: <1184053826.27071.445.camel@bashful.x10sys.com> On Mon, 2007-07-09 at 11:04 -0700, Chris Lattner wrote: > I think that "llvm-config --cppflags" should include "- > D__STDC_LIMIT_MACROS". What do you think? > This problem and other similar ones are now fixed. In order to make the fix visible, you may need to force the regeneration of your llvm-config after you update. I suggest this: cd llvm-top/llvm svn update rm Debug/bin/llvm-config make The problem was two fold: wrong var names in Makefile.rules, and wrong var name in tools/llvm-config/Makefile. There was also some cleanup in llvm-config.in.in that was needed. See the corresponding commits for details. As a test, I built llvm-config with things like ENABLE_EXPENSIVE_CHECKS=1 and it produces -DGLIBCXX_DEBUG option in the output of --cppflags --cxxflags and -cflags Reid. From isanbard at gmail.com Tue Jul 10 06:16:29 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 10 Jul 2007 04:16:29 -0700 Subject: [llvm-commits] [129252] Enable llvm-gcc to build when LLVM is configured with --enable-expensive-checks . In-Reply-To: <20070709175642.D6C2CD4EABA2@src> References: <20070709175642.D6C2CD4EABA2@src> Message-ID: <9DCD3EB0-7C68-4324-B8BC-32972F234374@gmail.com> I think that this commit is breaking the build. Here's the error I get: stage1/xgcc -Bstage1/ -B/usr/local/llvm-gcc-install/powerpc-apple- darwin9/bin/ -c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite- strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long- long -Wno-variadic-macros -Wold-style-definition -Werror - DHAVE_CONFIG_H -DGENERATOR_FILE -DENABLE_LLVM -D__STDC_LIMIT_MACROS - I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/src/llvm/ include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -I. -Ibuild - I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/src/gcc - I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/src/gcc/ build -I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/ src/gcc/../include -I./../intl -I/Volumes/SandBox/Clean/ llvm-1040-02.roots/llvm-1040-02~obj/src/gcc/../libcpp/include -I/ Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/src/llvm/ include -I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/ obj-llvm/include \ -o build/errors.o /Volumes/SandBox/Clean/llvm-1040-02.roots/ llvm-1040-02~obj/src/gcc/errors.c :1:1: error: "__STDC_LIMIT_MACROS" redefined :1:1: error: this is the location of the previous definition :1:1: error: "__STDC_LIMIT_MACROS" redefined :1:1: error: this is the location of the previous definition make[3]: *** [build/errors.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: *** [build/genmodes.o] Error 1 make[2]: *** [stage2_build] Error 2 make[1]: *** [bootstrap] Error 2 + exit 1 make: *** [install] Error 1 -bw On Jul 9, 2007, at 10:56 AM, clattner at apple.com wrote: > Revision: 129252 > Author: clattner > Date: 2007-07-09 10:56:42 -0700 (Mon, 09 Jul 2007) > > Log Message: > ----------- > Enable llvm-gcc to build when LLVM is configured with --enable- > expensive-checks. > > Patch by David Greene! > > Modified Paths: > -------------- > apple-local/branches/llvm/gcc/Makefile.in > apple-local/branches/llvm/gcc/configure > apple-local/branches/llvm/gcc/configure.ac > apple-local/branches/llvm/libcpp/configure > apple-local/branches/llvm/libcpp/configure.ac > > Modified: apple-local/branches/llvm/gcc/Makefile.in > =================================================================== > --- apple-local/branches/llvm/gcc/Makefile.in 2007-07-09 02:28:29 > UTC (rev 129251) > +++ apple-local/branches/llvm/gcc/Makefile.in 2007-07-09 17:56:42 > UTC (rev 129252) > @@ -217,26 +217,21 @@ > # APPLE LOCAL begin LLVM > @checkingenabled_flag@ > LLVMOBJDIR = @LLVMBASEPATH@ > -ifeq ($(LLVMOBJDIR),) > -CPPFLAGS = @CPPFLAGS@ > -else > -CPPFLAGS = @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS > > ifdef LLVM_VERSION_INFO > CPPFLAGS += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"' > endif > > -ifdef CHECKING_ENABLED > -BUILDMODE=Debug > -else > -ifdef DISABLE_LLVMASSERTIONS > -BUILDMODE=Release-Asserts > -else > -BUILDMODE=Release > -endif > -endif > +# Determine BUILDMODE from configure run (--enable-llvm) > +BUILDMODE := @LLVMBUILDMODE@ > + > LLVMBINPATH = $(LLVMOBJDIR)/$(BUILDMODE)/bin > > +ifeq ($(LLVMOBJDIR),) > +CPPFLAGS = @CPPFLAGS@ > +else > +CPPFLAGS := @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS $(shell > $(LLVMBINPATH)/llvm-config --cppflags) > + > # Use llvm-config to get the srcdir that LLVM was configured with, > to support > # srcdir != objdir builds. > LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root) > > Modified: apple-local/branches/llvm/gcc/configure > =================================================================== > --- apple-local/branches/llvm/gcc/configure 2007-07-09 02:28:29 UTC > (rev 129251) > +++ apple-local/branches/llvm/gcc/configure 2007-07-09 17:56:42 UTC > (rev 129252) > @@ -309,7 +309,7 @@ > # include > #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 datadir sysconfdir > sharedstatedir localstatedir libdir includedir oldincludedir > infodir mandir build_alias host_alias target_alias DEFS ECHO_C > ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host > host_cpu host_vendor host_os target target_cpu target_vendor > target_os target_noncanonical build_subdir host_subdir > target_subdir gcc_version_trigger gcc_version_full gcc_version > GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT > NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags > WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path > valgrind_path_defines valgrind_command coverage_flags > enable_multilib enable_shared TARGET_SYSTEM_ROOT > TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL > LLVMBASEPATH SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranl > ib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target > have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX > BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB > TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext > gthread_flags extra_modes_file PACKAGE VERSION USE_NLS LIBINTL > LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS > cc_for_cross_gnattools CROSS ALL SYSTEM_HEADER_DIR inhibit_libc > CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 > libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar > slibdir objdir subdirs srcdir all_boot_languages all_compilers > all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files > all_lang_makefrags all_lang_makefiles all_languages all_stagestuff > build_exeext build_install_headers_dir build_xm_file_list > build_xm_include_list build_xm_defines check_languages > cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir > xmake_file tmake_file extra_gcc_objs extra_headers_list extra_ > objs extra_parts extra_passes extra_programs float_h_file > gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir > host_exeext host_xm_file_list host_xm_include_list host_xm_defines > out_host_hook_obj install lang_opt_files lang_specs_files > lang_tree_files local_prefix md_file objc_boehm_gc out_file > out_cxx_file out_object_file out_cxx_object_file > stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure > thread_file tm_file_list tm_include_list tm_defines tm_p_file_list > tm_p_include_list xm_file_list xm_include_list xm_defines > c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path > GMPLIBS GMPINC LIBOBJS LTLIBOBJS' > +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 build build_cpu build_vendor build_os host > host_cpu host_vendor host_os target target_cpu target_vendor > target_os target_noncanonical build_subdir host_subdir > target_subdir gcc_version_trigger gcc_version_full gcc_version > GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT > NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags > WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path > valgrind_path_defines valgrind_command coverage_flags > enable_multilib enable_shared TARGET_SYSTEM_ROOT > TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL > LLVMBASEPATH LLVMBUILDMODE SET_MAKE AWK LN_S LN RANLIB ac_ > ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA > make_compare_target have_mktemp_command MAKEINFO BUILD_INFO > GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS > GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV > LIBICONV_DEP manext objext gthread_flags extra_modes_file PACKAGE > VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB > CATALOGS cc_for_cross_gnattools CROSS ALL SYSTEM_HEADER_DIR > inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO > collect2 libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir > dollar slibdir objdir subdirs srcdir all_boot_languages > all_compilers all_gtfiles all_gtfiles_files_langs > all_gtfiles_files_files all_lang_makefrags all_lang_makefiles > all_languages all_stagestuff build_exeext build_install_headers_dir > build_xm_file_list build_xm_include_list build_xm_defines > check_languages cc_set_by_configure quoted_cc_set_by_configure > cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_heade > rs_list extra_objs extra_parts extra_passes extra_programs > float_h_file gcc_config_arguments gcc_gxx_include_dir > libstdcxx_incdir host_exeext host_xm_file_list host_xm_include_list > host_xm_defines out_host_hook_obj install lang_opt_files > lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc > out_file out_cxx_file out_object_file out_cxx_object_file > stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure > thread_file tm_file_list tm_include_list tm_defines tm_p_file_list > tm_p_include_list xm_file_list xm_include_list xm_defines > c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path > GMPLIBS GMPINC LIBOBJS LTLIBOBJS' > ac_subst_files='language_hooks' > > # Initialize some variables set by options. > @@ -7089,10 +7089,28 @@ > > if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then > echo Found Release LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release" > elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then > echo Found Debug LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug" > elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then > echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release-Asserts" > + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then > + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug-Asserts" > + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then > + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release+Checks" > + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then > + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug+Checks" > + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc > $EXEEXT"; then > + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release-Asserts+Checks" > + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; > then > + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug-Asserts+Checks" > else > { { echo "$as_me:$LINENO: error: You must specify valid path > to your LLVM tree with --enable-llvm=DIR" >&5 > echo "$as_me: error: You must specify valid path to your LLVM tree > with --enable-llvm=DIR" >&2;} > @@ -7101,8 +7119,12 @@ > > else > LLVMBASEPATH="" > + LLVMBUILDMODE="" > + > fi; > > +# Send llvm build mode to gcc Makefiles > + > # APPLE LOCAL end LLVM > > # Sanity check enable_languages in case someone does not run the > toplevel > @@ -7732,7 +7754,7 @@ > else > ac_prog_version=`$MAKEINFO --version 2>&1 | > sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/ > \1/p'` > - echo "configure:7735: version of makeinfo is $ac_prog_version" >&5 > + echo "configure:7757: version of makeinfo is $ac_prog_version" >&5 > case $ac_prog_version in > '') gcc_cv_prog_makeinfo_modern=no;; > 4.[2-9]*) > @@ -16669,6 +16691,7 @@ > s, at onestep@,$onestep,;t t > s, at DSYMUTIL@,$DSYMUTIL,;t t > s, at LLVMBASEPATH@,$LLVMBASEPATH,;t t > +s, at LLVMBUILDMODE@,$LLVMBUILDMODE,;t t > s, at SET_MAKE@,$SET_MAKE,;t t > s, at AWK@,$AWK,;t t > s, at LN_S@,$LN_S,;t t > > Modified: apple-local/branches/llvm/gcc/configure.ac > =================================================================== > --- apple-local/branches/llvm/gcc/configure.ac 2007-07-09 02:28:29 > UTC (rev 129251) > +++ apple-local/branches/llvm/gcc/configure.ac 2007-07-09 17:56:42 > UTC (rev 129252) > @@ -745,16 +745,38 @@ > > if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then > echo Found Release LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release" > elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then > echo Found Debug LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug" > elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then > echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release-Asserts" > + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then > + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug-Asserts" > + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then > + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release+Checks" > + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then > + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug+Checks" > + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc > $EXEEXT"; then > + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release-Asserts+Checks" > + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; > then > + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug-Asserts+Checks" > else > AC_MSG_ERROR([You must specify valid path to your LLVM tree > with --enable-llvm=DIR]) > fi > ], > -[LLVMBASEPATH=""]) > +[LLVMBASEPATH="" > + LLVMBUILDMODE="" > +]) > AC_SUBST(LLVMBASEPATH) > +# Send llvm build mode to gcc Makefiles > +AC_SUBST(LLVMBUILDMODE) > # APPLE LOCAL end LLVM > > # Sanity check enable_languages in case someone does not run the > toplevel > > Modified: apple-local/branches/llvm/libcpp/configure > =================================================================== > --- apple-local/branches/llvm/libcpp/configure 2007-07-09 02:28:29 > UTC (rev 129251) > +++ apple-local/branches/llvm/libcpp/configure 2007-07-09 17:56:42 > UTC (rev 129252) > @@ -8023,10 +8023,28 @@ > > if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then > echo Found Release LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release" > elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then > echo Found Debug LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug" > elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then > echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release-Asserts" > + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then > + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug-Asserts" > + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then > + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release+Checks" > + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then > + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug+Checks" > + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc > $EXEEXT"; then > + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release-Asserts+Checks" > + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; > then > + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug-Asserts+Checks" > else > { { echo "$as_me:$LINENO: error: You must specify valid path > to your LLVM tree with --enable-llvm=DIR" >&5 > echo "$as_me: error: You must specify valid path to your LLVM tree > with --enable-llvm=DIR" >&2;} > > Modified: apple-local/branches/llvm/libcpp/configure.ac > =================================================================== > --- apple-local/branches/llvm/libcpp/configure.ac 2007-07-09 > 02:28:29 UTC (rev 129251) > +++ apple-local/branches/llvm/libcpp/configure.ac 2007-07-09 > 17:56:42 UTC (rev 129252) > @@ -108,9 +108,7 @@ > case $target in > # APPLE LOCAL begin 4126124 > alpha*-*-* | \ > - #APPLE LOCAL begin LLVM > arm*-*-*eabi* | \ > - #APPLE LOCAL end LLVM > arm*-*-symbianelf* | \ > x86_64-*-* | \ > ia64-*-* | \ > @@ -161,10 +159,28 @@ > > if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then > echo Found Release LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release" > elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then > echo Found Debug LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug" > elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then > echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release-Asserts" > + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then > + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug-Asserts" > + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then > + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release+Checks" > + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then > + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug+Checks" > + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc > $EXEEXT"; then > + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Release-Asserts+Checks" > + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; > then > + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH > + LLVMBUILDMODE="Debug-Asserts+Checks" > else > AC_MSG_ERROR([You must specify valid path to your LLVM tree > with --enable-llvm=DIR]) > fi > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Tue Jul 10 09:17:21 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 10 Jul 2007 16:17:21 +0200 Subject: [llvm-commits] llvm-gcc: always create a call to eh.selector, even if there are no type infos Message-ID: <200707101617.22511.baldrick@free.fr> A function that only has cleanups (destructors) to run when an exception is raised currently is not assigned a personality function because we don't bother creating a call to eh.selector if there are no catches. But the personality function is still needed, since it is the personality function that analyses the exception table and decides where to jump to (to the cleanups in this case). This patch causes a call to eh.selector to be generated in every landing pad, even if it has no type infos, because that specifies the personality function. Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: cleanup_personality.diff Type: text/x-diff Size: 1887 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070710/58246777/attachment.bin From djg at cray.com Tue Jul 10 09:20:38 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 10 Jul 2007 14:20:38 -0000 Subject: [llvm-commits] [llvm] r38489 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200707101420.l6AEKcCk000933@zion.cs.uiuc.edu> Author: djg Date: Tue Jul 10 09:20:37 2007 New Revision: 38489 URL: http://llvm.org/viewvc/llvm-project?rev=38489&view=rev Log: Fix the folding of undef in several binary operators to recognize undef in either the left or right operand. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=38489&r1=38488&r2=38489&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Jul 10 09:20:37 2007 @@ -855,7 +855,7 @@ if (FoldedVOp.Val) return FoldedVOp; // fold (add x, undef) -> undef - if (N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) return N1; // fold (add c1, c2) -> c1+c2 if (N0C && N1C) @@ -1047,7 +1047,7 @@ if (FoldedVOp.Val) return FoldedVOp; // fold (mul x, undef) -> 0 - if (N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) return DAG.getConstant(0, VT); // fold (mul c1, c2) -> c1*c2 if (N0C && N1C) @@ -1339,7 +1339,7 @@ DAG.getConstant(MVT::getSizeInBits(N0.getValueType())-1, TLI.getShiftAmountTy())); // fold (mulhs x, undef) -> 0 - if (N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) return DAG.getConstant(0, VT); return SDOperand(); @@ -1358,7 +1358,7 @@ if (N1C && N1C->getValue() == 1) return DAG.getConstant(0, N0.getValueType()); // fold (mulhu x, undef) -> 0 - if (N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) return DAG.getConstant(0, VT); return SDOperand(); @@ -1416,7 +1416,7 @@ if (FoldedVOp.Val) return FoldedVOp; // fold (and x, undef) -> 0 - if (N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) return DAG.getConstant(0, VT); // fold (and c1, c2) -> c1&c2 if (N0C && N1C) @@ -1604,7 +1604,7 @@ if (FoldedVOp.Val) return FoldedVOp; // fold (or x, undef) -> -1 - if (N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) return DAG.getConstant(~0ULL, VT); // fold (or c1, c2) -> c1|c2 if (N0C && N1C) @@ -1890,7 +1890,7 @@ if (FoldedVOp.Val) return FoldedVOp; // fold (xor x, undef) -> undef - if (N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) return N1; // fold (xor c1, c2) -> c1^c2 if (N0C && N1C) From lauro.venancio at gmail.com Tue Jul 10 09:29:35 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 10 Jul 2007 11:29:35 -0300 Subject: [llvm-commits] [llvm] r38489 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp In-Reply-To: <200707101420.l6AEKcCk000933@zion.cs.uiuc.edu> References: <200707101420.l6AEKcCk000933@zion.cs.uiuc.edu> Message-ID: <9c10c9f0707100729v1fba2207l4ec0a8865874ab3c@mail.gmail.com> Hi Dan, There is a bug in the following code. If N0 is UNDEF, the code returns N1 instead of UNDEF. Lauro > @@ -855,7 +855,7 @@ > if (FoldedVOp.Val) return FoldedVOp; > > // fold (add x, undef) -> undef > - if (N1.getOpcode() == ISD::UNDEF) > + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) > return N1; > // fold (add c1, c2) -> c1+c2 > if (N0C && N1C) > @@ -1890,7 +1890,7 @@ > if (FoldedVOp.Val) return FoldedVOp; > > // fold (xor x, undef) -> undef > - if (N1.getOpcode() == ISD::UNDEF) > + if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) > return N1; > // fold (xor c1, c2) -> c1^c2 > if (N0C && N1C) From reid at x10sys.com Tue Jul 10 09:52:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Jul 2007 14:52:02 -0000 Subject: [llvm-commits] [llvm] r38490 - /llvm/trunk/Makefile.rules Message-ID: <200707101452.l6AEq2t1002588@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 09:52:01 2007 New Revision: 38490 URL: http://llvm.org/viewvc/llvm-project?rev=38490&view=rev Log: Make sure to keep symbols for profile build. Patch by Benoit Boissinot. Thanks, Benoit! Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=38490&r1=38489&r2=38490&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Jul 10 09:52:01 2007 @@ -213,6 +213,7 @@ 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 From rspencer at reidspencer.com Tue Jul 10 09:55:34 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 10 Jul 2007 07:55:34 -0700 Subject: [llvm-commits] [129252] Enable llvm-gcc to build when LLVM is configured with --enable-expensive-checks . In-Reply-To: <9DCD3EB0-7C68-4324-B8BC-32972F234374@gmail.com> References: <20070709175642.D6C2CD4EABA2@src> <9DCD3EB0-7C68-4324-B8BC-32972F234374@gmail.com> Message-ID: <1184079334.3144.6.camel@bashful.x10sys.com> Bill, Last night I changed llvm-config to produce _STDC_LIMIT_MACROS because previously it wasn't and it is required to build/use LLVM. So, I think you'll have to remove the -D_STDC_LIMIT_MACROS from CPPFLAGS line in Makefile.in. Reid. On Tue, 2007-07-10 at 04:16 -0700, Bill Wendling wrote: > I think that this commit is breaking the build. Here's the error I get: > > stage1/xgcc -Bstage1/ -B/usr/local/llvm-gcc-install/powerpc-apple- > darwin9/bin/ -c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite- > strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long- > long -Wno-variadic-macros -Wold-style-definition -Werror - > DHAVE_CONFIG_H -DGENERATOR_FILE -DENABLE_LLVM -D__STDC_LIMIT_MACROS - > I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/src/llvm/ > include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -I. -Ibuild - > I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/src/gcc - > I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/src/gcc/ > build -I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/ > src/gcc/../include -I./../intl -I/Volumes/SandBox/Clean/ > llvm-1040-02.roots/llvm-1040-02~obj/src/gcc/../libcpp/include -I/ > Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/src/llvm/ > include -I/Volumes/SandBox/Clean/llvm-1040-02.roots/llvm-1040-02~obj/ > obj-llvm/include \ > -o build/errors.o /Volumes/SandBox/Clean/llvm-1040-02.roots/ > llvm-1040-02~obj/src/gcc/errors.c > :1:1: error: "__STDC_LIMIT_MACROS" redefined > :1:1: error: this is the location of the previous > definition > :1:1: error: "__STDC_LIMIT_MACROS" redefined > :1:1: error: this is the location of the previous > definition > make[3]: *** [build/errors.o] Error 1 > make[3]: *** Waiting for unfinished jobs.... > make[3]: *** [build/genmodes.o] Error 1 > make[2]: *** [stage2_build] Error 2 > make[1]: *** [bootstrap] Error 2 > + exit 1 > make: *** [install] Error 1 > > -bw > > On Jul 9, 2007, at 10:56 AM, clattner at apple.com wrote: > > > Revision: 129252 > > Author: clattner > > Date: 2007-07-09 10:56:42 -0700 (Mon, 09 Jul 2007) > > > > Log Message: > > ----------- > > Enable llvm-gcc to build when LLVM is configured with --enable- > > expensive-checks. > > > > Patch by David Greene! > > > > Modified Paths: > > -------------- > > apple-local/branches/llvm/gcc/Makefile.in > > apple-local/branches/llvm/gcc/configure > > apple-local/branches/llvm/gcc/configure.ac > > apple-local/branches/llvm/libcpp/configure > > apple-local/branches/llvm/libcpp/configure.ac > > > > Modified: apple-local/branches/llvm/gcc/Makefile.in > > =================================================================== > > --- apple-local/branches/llvm/gcc/Makefile.in 2007-07-09 02:28:29 > > UTC (rev 129251) > > +++ apple-local/branches/llvm/gcc/Makefile.in 2007-07-09 17:56:42 > > UTC (rev 129252) > > @@ -217,26 +217,21 @@ > > # APPLE LOCAL begin LLVM > > @checkingenabled_flag@ > > LLVMOBJDIR = @LLVMBASEPATH@ > > -ifeq ($(LLVMOBJDIR),) > > -CPPFLAGS = @CPPFLAGS@ > > -else > > -CPPFLAGS = @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS > > > > ifdef LLVM_VERSION_INFO > > CPPFLAGS += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"' > > endif > > > > -ifdef CHECKING_ENABLED > > -BUILDMODE=Debug > > -else > > -ifdef DISABLE_LLVMASSERTIONS > > -BUILDMODE=Release-Asserts > > -else > > -BUILDMODE=Release > > -endif > > -endif > > +# Determine BUILDMODE from configure run (--enable-llvm) > > +BUILDMODE := @LLVMBUILDMODE@ > > + > > LLVMBINPATH = $(LLVMOBJDIR)/$(BUILDMODE)/bin > > > > +ifeq ($(LLVMOBJDIR),) > > +CPPFLAGS = @CPPFLAGS@ > > +else > > +CPPFLAGS := @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS $(shell > > $(LLVMBINPATH)/llvm-config --cppflags) > > + > > # Use llvm-config to get the srcdir that LLVM was configured with, > > to support > > # srcdir != objdir builds. > > LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root) > > > > Modified: apple-local/branches/llvm/gcc/configure > > =================================================================== > > --- apple-local/branches/llvm/gcc/configure 2007-07-09 02:28:29 UTC > > (rev 129251) > > +++ apple-local/branches/llvm/gcc/configure 2007-07-09 17:56:42 UTC > > (rev 129252) > > @@ -309,7 +309,7 @@ > > # include > > #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 datadir sysconfdir > > sharedstatedir localstatedir libdir includedir oldincludedir > > infodir mandir build_alias host_alias target_alias DEFS ECHO_C > > ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host > > host_cpu host_vendor host_os target target_cpu target_vendor > > target_os target_noncanonical build_subdir host_subdir > > target_subdir gcc_version_trigger gcc_version_full gcc_version > > GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT > > NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags > > WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path > > valgrind_path_defines valgrind_command coverage_flags > > enable_multilib enable_shared TARGET_SYSTEM_ROOT > > TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL > > LLVMBASEPATH SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranl > > ib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target > > have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX > > BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB > > TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext > > gthread_flags extra_modes_file PACKAGE VERSION USE_NLS LIBINTL > > LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS > > cc_for_cross_gnattools CROSS ALL SYSTEM_HEADER_DIR inhibit_libc > > CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 > > libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar > > slibdir objdir subdirs srcdir all_boot_languages all_compilers > > all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files > > all_lang_makefrags all_lang_makefiles all_languages all_stagestuff > > build_exeext build_install_headers_dir build_xm_file_list > > build_xm_include_list build_xm_defines check_languages > > cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir > > xmake_file tmake_file extra_gcc_objs extra_headers_list extra_ > > objs extra_parts extra_passes extra_programs float_h_file > > gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir > > host_exeext host_xm_file_list host_xm_include_list host_xm_defines > > out_host_hook_obj install lang_opt_files lang_specs_files > > lang_tree_files local_prefix md_file objc_boehm_gc out_file > > out_cxx_file out_object_file out_cxx_object_file > > stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure > > thread_file tm_file_list tm_include_list tm_defines tm_p_file_list > > tm_p_include_list xm_file_list xm_include_list xm_defines > > c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path > > GMPLIBS GMPINC LIBOBJS LTLIBOBJS' > > +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 build build_cpu build_vendor build_os host > > host_cpu host_vendor host_os target target_cpu target_vendor > > target_os target_noncanonical build_subdir host_subdir > > target_subdir gcc_version_trigger gcc_version_full gcc_version > > GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT > > NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags > > WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path > > valgrind_path_defines valgrind_command coverage_flags > > enable_multilib enable_shared TARGET_SYSTEM_ROOT > > TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL > > LLVMBASEPATH LLVMBUILDMODE SET_MAKE AWK LN_S LN RANLIB ac_ > > ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA > > make_compare_target have_mktemp_command MAKEINFO BUILD_INFO > > GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS > > GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV > > LIBICONV_DEP manext objext gthread_flags extra_modes_file PACKAGE > > VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB > > CATALOGS cc_for_cross_gnattools CROSS ALL SYSTEM_HEADER_DIR > > inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO > > collect2 libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir > > dollar slibdir objdir subdirs srcdir all_boot_languages > > all_compilers all_gtfiles all_gtfiles_files_langs > > all_gtfiles_files_files all_lang_makefrags all_lang_makefiles > > all_languages all_stagestuff build_exeext build_install_headers_dir > > build_xm_file_list build_xm_include_list build_xm_defines > > check_languages cc_set_by_configure quoted_cc_set_by_configure > > cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_heade > > rs_list extra_objs extra_parts extra_passes extra_programs > > float_h_file gcc_config_arguments gcc_gxx_include_dir > > libstdcxx_incdir host_exeext host_xm_file_list host_xm_include_list > > host_xm_defines out_host_hook_obj install lang_opt_files > > lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc > > out_file out_cxx_file out_object_file out_cxx_object_file > > stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure > > thread_file tm_file_list tm_include_list tm_defines tm_p_file_list > > tm_p_include_list xm_file_list xm_include_list xm_defines > > c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path > > GMPLIBS GMPINC LIBOBJS LTLIBOBJS' > > ac_subst_files='language_hooks' > > > > # Initialize some variables set by options. > > @@ -7089,10 +7089,28 @@ > > > > if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then > > echo Found Release LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release" > > elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then > > echo Found Debug LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug" > > elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then > > echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release-Asserts" > > + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then > > + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug-Asserts" > > + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then > > + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release+Checks" > > + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then > > + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug+Checks" > > + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc > > $EXEEXT"; then > > + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release-Asserts+Checks" > > + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; > > then > > + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug-Asserts+Checks" > > else > > { { echo "$as_me:$LINENO: error: You must specify valid path > > to your LLVM tree with --enable-llvm=DIR" >&5 > > echo "$as_me: error: You must specify valid path to your LLVM tree > > with --enable-llvm=DIR" >&2;} > > @@ -7101,8 +7119,12 @@ > > > > else > > LLVMBASEPATH="" > > + LLVMBUILDMODE="" > > + > > fi; > > > > +# Send llvm build mode to gcc Makefiles > > + > > # APPLE LOCAL end LLVM > > > > # Sanity check enable_languages in case someone does not run the > > toplevel > > @@ -7732,7 +7754,7 @@ > > else > > ac_prog_version=`$MAKEINFO --version 2>&1 | > > sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/ > > \1/p'` > > - echo "configure:7735: version of makeinfo is $ac_prog_version" >&5 > > + echo "configure:7757: version of makeinfo is $ac_prog_version" >&5 > > case $ac_prog_version in > > '') gcc_cv_prog_makeinfo_modern=no;; > > 4.[2-9]*) > > @@ -16669,6 +16691,7 @@ > > s, at onestep@,$onestep,;t t > > s, at DSYMUTIL@,$DSYMUTIL,;t t > > s, at LLVMBASEPATH@,$LLVMBASEPATH,;t t > > +s, at LLVMBUILDMODE@,$LLVMBUILDMODE,;t t > > s, at SET_MAKE@,$SET_MAKE,;t t > > s, at AWK@,$AWK,;t t > > s, at LN_S@,$LN_S,;t t > > > > Modified: apple-local/branches/llvm/gcc/configure.ac > > =================================================================== > > --- apple-local/branches/llvm/gcc/configure.ac 2007-07-09 02:28:29 > > UTC (rev 129251) > > +++ apple-local/branches/llvm/gcc/configure.ac 2007-07-09 17:56:42 > > UTC (rev 129252) > > @@ -745,16 +745,38 @@ > > > > if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then > > echo Found Release LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release" > > elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then > > echo Found Debug LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug" > > elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then > > echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release-Asserts" > > + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then > > + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug-Asserts" > > + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then > > + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release+Checks" > > + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then > > + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug+Checks" > > + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc > > $EXEEXT"; then > > + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release-Asserts+Checks" > > + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; > > then > > + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug-Asserts+Checks" > > else > > AC_MSG_ERROR([You must specify valid path to your LLVM tree > > with --enable-llvm=DIR]) > > fi > > ], > > -[LLVMBASEPATH=""]) > > +[LLVMBASEPATH="" > > + LLVMBUILDMODE="" > > +]) > > AC_SUBST(LLVMBASEPATH) > > +# Send llvm build mode to gcc Makefiles > > +AC_SUBST(LLVMBUILDMODE) > > # APPLE LOCAL end LLVM > > > > # Sanity check enable_languages in case someone does not run the > > toplevel > > > > Modified: apple-local/branches/llvm/libcpp/configure > > =================================================================== > > --- apple-local/branches/llvm/libcpp/configure 2007-07-09 02:28:29 > > UTC (rev 129251) > > +++ apple-local/branches/llvm/libcpp/configure 2007-07-09 17:56:42 > > UTC (rev 129252) > > @@ -8023,10 +8023,28 @@ > > > > if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then > > echo Found Release LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release" > > elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then > > echo Found Debug LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug" > > elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then > > echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release-Asserts" > > + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then > > + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug-Asserts" > > + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then > > + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release+Checks" > > + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then > > + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug+Checks" > > + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc > > $EXEEXT"; then > > + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release-Asserts+Checks" > > + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; > > then > > + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug-Asserts+Checks" > > else > > { { echo "$as_me:$LINENO: error: You must specify valid path > > to your LLVM tree with --enable-llvm=DIR" >&5 > > echo "$as_me: error: You must specify valid path to your LLVM tree > > with --enable-llvm=DIR" >&2;} > > > > Modified: apple-local/branches/llvm/libcpp/configure.ac > > =================================================================== > > --- apple-local/branches/llvm/libcpp/configure.ac 2007-07-09 > > 02:28:29 UTC (rev 129251) > > +++ apple-local/branches/llvm/libcpp/configure.ac 2007-07-09 > > 17:56:42 UTC (rev 129252) > > @@ -108,9 +108,7 @@ > > case $target in > > # APPLE LOCAL begin 4126124 > > alpha*-*-* | \ > > - #APPLE LOCAL begin LLVM > > arm*-*-*eabi* | \ > > - #APPLE LOCAL end LLVM > > arm*-*-symbianelf* | \ > > x86_64-*-* | \ > > ia64-*-* | \ > > @@ -161,10 +159,28 @@ > > > > if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then > > echo Found Release LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release" > > elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then > > echo Found Debug LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug" > > elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then > > echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release-Asserts" > > + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then > > + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug-Asserts" > > + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then > > + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release+Checks" > > + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then > > + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug+Checks" > > + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc > > $EXEEXT"; then > > + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Release-Asserts+Checks" > > + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; > > then > > + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH > > + LLVMBUILDMODE="Debug-Asserts+Checks" > > else > > AC_MSG_ERROR([You must specify valid path to your LLVM tree > > with --enable-llvm=DIR]) > > fi > > > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From djg at cray.com Tue Jul 10 10:19:30 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 10 Jul 2007 15:19:30 -0000 Subject: [llvm-commits] [llvm] r38491 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200707101519.l6AFJUe8003389@zion.cs.uiuc.edu> Author: djg Date: Tue Jul 10 10:19:29 2007 New Revision: 38491 URL: http://llvm.org/viewvc/llvm-project?rev=38491&view=rev Log: Fix a bug in the folding of binary operators to undef. Thanks to Lauro for spotting this! Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=38491&r1=38490&r2=38491&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Jul 10 10:19:29 2007 @@ -855,7 +855,9 @@ if (FoldedVOp.Val) return FoldedVOp; // fold (add x, undef) -> undef - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF) + return N0; + if (N1.getOpcode() == ISD::UNDEF) return N1; // fold (add c1, c2) -> c1+c2 if (N0C && N1C) @@ -1029,8 +1031,10 @@ if (Result.Val) return Result; } // If either operand of a sub is undef, the result is undef - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) - return DAG.getNode(ISD::UNDEF, VT); + if (N0.getOpcode() == ISD::UNDEF) + return N0; + if (N1.getOpcode() == ISD::UNDEF) + return N1; return SDOperand(); } @@ -1890,7 +1894,9 @@ if (FoldedVOp.Val) return FoldedVOp; // fold (xor x, undef) -> undef - if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) + if (N0.getOpcode() == ISD::UNDEF) + return N0; + if (N1.getOpcode() == ISD::UNDEF) return N1; // fold (xor c1, c2) -> c1^c2 if (N0C && N1C) From djg at cray.com Tue Jul 10 10:34:29 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 10 Jul 2007 15:34:29 -0000 Subject: [llvm-commits] [llvm] r38492 - /llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll Message-ID: <200707101534.l6AFYTe1003914@zion.cs.uiuc.edu> Author: djg Date: Tue Jul 10 10:34:29 2007 New Revision: 38492 URL: http://llvm.org/viewvc/llvm-project?rev=38492&view=rev Log: Add a regression test for folding spill code into scalar min and max. Added: llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll Added: llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll?rev=38492&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll (added) +++ llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll Tue Jul 10 10:34:29 2007 @@ -0,0 +1,20 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep min | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=x86-64 | grep max | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | wc -l | grep 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 +} From djg at cray.com Tue Jul 10 10:46:47 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 10 Jul 2007 10:46:47 -0500 Subject: [llvm-commits] [llvm] r38478 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td X86RegisterInfo.cpp Message-ID: <20070710154647.GG5693@village.us.cray.com> > Nice. Testcase please :). What sort of code does this improve? Ok, I added a testcase for the scalar min and max fix. That improves code that uses SSE min or max and an operand is spilled. For vector sqrt and friends, we'll need more support in LLVM before they can really be useful. I'm working on a patch to add support for intrinsic functions with vector argument and result types that can be overloaded on vector length. Dan -- Dan Gohman, Cray Inc. From resistor at mac.com Tue Jul 10 12:08:11 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 17:08:11 -0000 Subject: [llvm-commits] [llvm] r38493 - in /llvm/trunk: include/llvm/Analysis/MemoryDependenceAnalysis.h lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200707101708.l6AH8CqW006891@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 12:08:11 2007 New Revision: 38493 URL: http://llvm.org/viewvc/llvm-project?rev=38493&view=rev Log: Fix a bunch of things from Chris' feedback Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=38493&r1=38492&r2=38493&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Tue Jul 10 12:08:11 2007 @@ -28,7 +28,7 @@ class FunctionPass; class Instruction; -class VISIBILITY_HIDDEN MemoryDependenceAnalysis : public FunctionPass { +class MemoryDependenceAnalysis : public FunctionPass { private: DenseMap > depGraphLocal; @@ -44,10 +44,12 @@ /// Pass Implementation stuff. This doesn't do any analysis. /// - bool runOnFunction(Function &) { + bool runOnFunction(Function &) {return false; } + + /// Clean up memory in between runs + void releaseMemory() { depGraphLocal.clear(); reverseDep.clear(); - return false; } /// getAnalysisUsage - Does not modify anything. It uses Value Numbering Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=38493&r1=38492&r2=38493&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 10 12:08:11 2007 @@ -40,8 +40,8 @@ } /// getDependency - Return the instruction on which a memory operation -/// depends. NOTE: A return value of NULL indicates that no dependency -/// was found in the parent block. +/// depends. The local paramter indicates if the query should only +/// evaluate dependencies within the same basic block. Instruction* MemoryDependenceAnalysis::getDependency(Instruction* query, bool local) { if (!local) @@ -60,51 +60,68 @@ QI = cachedResult.first; AliasAnalysis& AA = getAnalysis(); - - BasicBlock::iterator blockBegin = query->getParent()->begin(); + TargetData& TD = getAnalysis(); // Get the pointer value for which dependence will be determined Value* dependee = 0; - if (StoreInst* S = dyn_cast(QI)) + uint64_t dependeeSize = 0; + if (StoreInst* S = dyn_cast(QI)) { dependee = S->getPointerOperand(); - else if (LoadInst* L = dyn_cast(QI)) + dependeeSize = TD.getTypeSize(dependee->getType()); + } else if (LoadInst* L = dyn_cast(QI)) { dependee = L->getPointerOperand(); - else if (FreeInst* F = dyn_cast(QI)) + dependeeSize = TD.getTypeSize(dependee->getType()); + } else if (FreeInst* F = dyn_cast(QI)) { dependee = F->getPointerOperand(); - else if (isa(query)) { + + // FreeInsts erase the entire structure, not just a field + dependeeSize = ~0UL; + } else if (isa(query)) { // Allocations don't depend on anything depGraphLocal.insert(std::make_pair(query, std::make_pair(None, true))); reverseDep.insert(std::make_pair(None, query)); return None; - } else { - // Non-memory operations depend on their immediate predecessor - --QI; - depGraphLocal.insert(std::make_pair(query, std::make_pair(QI, true))); - reverseDep.insert(std::make_pair(QI, query)); - return QI; - } + } else + // FIXME: Call/InvokeInsts need proper handling + return None; - // Start with the predecessor of the queried inst - --QI; - TargetData& TD = getAnalysis(); + BasicBlock::iterator blockBegin = query->getParent()->begin(); while (QI != blockBegin) { + --QI; + + // If we've reached the pointer's definition... + if (QI == dependee) { + depGraphLocal.insert(std::make_pair(query, std::make_pair(QI, true))); + reverseDep.insert(std::make_pair(QI, query)); + return QI; + } + // If this inst is a memory op, get the pointer it accessed Value* pointer = 0; - if (StoreInst* S = dyn_cast(QI)) + uint64_t pointerSize = 0; + if (StoreInst* S = dyn_cast(QI)) { pointer = S->getPointerOperand(); - else if (LoadInst* L = dyn_cast(QI)) + pointerSize = TD.getTypeSize(pointer->getType()); + } else if (LoadInst* L = dyn_cast(QI)) { pointer = L->getPointerOperand(); - else if (isa(QI)) - pointer = QI; - else if (FreeInst* F = dyn_cast(QI)) + pointerSize = TD.getTypeSize(pointer->getType()); + } else if (AllocationInst* AI = dyn_cast(QI)) { + pointer = AI; + if (isa(AI->getArraySize())) + pointerSize = AI->getZExtValue(); + else + pointerSize = ~0UL; + } else if (FreeInst* F = dyn_cast(QI)) { pointer = F->getPointerOperand(); - else if (CallInst* C = dyn_cast(QI)) { + + // FreeInsts erase the entire structure + pointerSize = ~0UL; + } else if (CallSite* C = dyn_cast(QI)) { // Call insts need special handling. Check is they can modify our pointer - if (AA.getModRefInfo(C, dependee, TD.getTypeSize(dependee->getType())) != - AliasAnalysis::NoModRef) { + if (AA.getModRefInfo(C, dependee, dependeeSize) != AliasAnalysis::NoModRef) { depGraphLocal.insert(std::make_pair(query, std::make_pair(C, true))); reverseDep.insert(std::make_pair(C, query)); return C; @@ -115,9 +132,8 @@ // If we found a pointer, check if it could be the same as our pointer if (pointer) { - AliasAnalysis::AliasResult R = AA.alias( - pointer, TD.getTypeSize(pointer->getType()), - dependee, TD.getTypeSize(dependee->getType())); + AliasAnalysis::AliasResult R = AA.alias(pointer, pointerSize, + dependee, dependeeSize); if (R != AliasAnalysis::NoAlias) { depGraphLocal.insert(std::make_pair(query, std::make_pair(QI, true))); @@ -125,8 +141,6 @@ return QI; } } - - QI--; } // If we found nothing, return the non-local flag From resistor at mac.com Tue Jul 10 12:25:04 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 17:25:04 -0000 Subject: [llvm-commits] [llvm] r38494 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200707101725.l6AHP4xh007594@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 12:25:03 2007 New Revision: 38494 URL: http://llvm.org/viewvc/llvm-project?rev=38494&view=rev Log: Fix the build, and fix the handling of pointer sizes. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=38494&r1=38493&r2=38494&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 10 12:25:03 2007 @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/MemoryDependenceAnalysis.h" +#include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Function.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -67,22 +68,18 @@ uint64_t dependeeSize = 0; if (StoreInst* S = dyn_cast(QI)) { dependee = S->getPointerOperand(); - dependeeSize = TD.getTypeSize(dependee->getType()); + dependeeSize = TD.getTypeSize(S->getOperand(0)->getType()); } else if (LoadInst* L = dyn_cast(QI)) { dependee = L->getPointerOperand(); - dependeeSize = TD.getTypeSize(dependee->getType()); + dependeeSize = TD.getTypeSize(L->getType()); } else if (FreeInst* F = dyn_cast(QI)) { dependee = F->getPointerOperand(); // FreeInsts erase the entire structure, not just a field dependeeSize = ~0UL; - } else if (isa(query)) { - // Allocations don't depend on anything - depGraphLocal.insert(std::make_pair(query, std::make_pair(None, - true))); - reverseDep.insert(std::make_pair(None, query)); + } else if (isa(query)) return None; - } else + else // FIXME: Call/InvokeInsts need proper handling return None; @@ -92,26 +89,19 @@ while (QI != blockBegin) { --QI; - // If we've reached the pointer's definition... - if (QI == dependee) { - depGraphLocal.insert(std::make_pair(query, std::make_pair(QI, true))); - reverseDep.insert(std::make_pair(QI, query)); - return 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(QI)) { pointer = S->getPointerOperand(); - pointerSize = TD.getTypeSize(pointer->getType()); + pointerSize = TD.getTypeSize(S->getOperand(0)->getType()); } else if (LoadInst* L = dyn_cast(QI)) { pointer = L->getPointerOperand(); - pointerSize = TD.getTypeSize(pointer->getType()); + pointerSize = TD.getTypeSize(L->getType()); } else if (AllocationInst* AI = dyn_cast(QI)) { pointer = AI; - if (isa(AI->getArraySize())) - pointerSize = AI->getZExtValue(); + if (ConstantInt* C = dyn_cast(AI->getArraySize())) + pointerSize = C->getZExtValue(); else pointerSize = ~0UL; } else if (FreeInst* F = dyn_cast(QI)) { @@ -119,7 +109,7 @@ // FreeInsts erase the entire structure pointerSize = ~0UL; - } else if (CallSite* C = dyn_cast(QI)) { + } else if (CallInst* C = dyn_cast(QI)) { // Call insts need special handling. Check is they can modify our pointer if (AA.getModRefInfo(C, dependee, dependeeSize) != AliasAnalysis::NoModRef) { depGraphLocal.insert(std::make_pair(query, std::make_pair(C, true))); @@ -128,6 +118,15 @@ } else { continue; } + } else if (InvokeInst* I = dyn_cast(QI)) { + // Invoke insts need special handling. Check is they can modify our pointer + if (AA.getModRefInfo(I, dependee, dependeeSize) != AliasAnalysis::NoModRef) { + depGraphLocal.insert(std::make_pair(query, std::make_pair(I, true))); + reverseDep.insert(std::make_pair(I, query)); + return I; + } else { + continue; + } } // If we found a pointer, check if it could be the same as our pointer From clattner at apple.com Tue Jul 10 12:47:00 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 10 Jul 2007 10:47:00 -0700 Subject: [llvm-commits] [llvm] r38478 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td X86RegisterInfo.cpp In-Reply-To: <20070710154647.GG5693@village.us.cray.com> References: <20070710154647.GG5693@village.us.cray.com> Message-ID: On Jul 10, 2007, at 8:46 AM, Dan Gohman wrote: >> Nice. Testcase please :). What sort of code does this improve? > > Ok, I added a testcase for the scalar min and max fix. That improves > code that uses SSE min or max and an operand is spilled. Ok, thanks! > For vector sqrt and friends, we'll need more support in LLVM before > they can really be useful. I'm working on a patch to add support > for intrinsic functions with vector argument and result types that > can be overloaded on vector length. Nifty. One thing to be careful of is the use of the rsqrt instruction. Even with the refinement step using them should be limited to "fast-math" mode only. -Chris From clattner at apple.com Tue Jul 10 12:46:47 2007 From: clattner at apple.com (clattner at apple.com) Date: Tue, 10 Jul 2007 10:46:47 -0700 (PDT) Subject: [llvm-commits] [129261] remove redundant -D option. Message-ID: <20070710174647.1E1C4D87463B@src> Revision: 129261 Author: clattner Date: 2007-07-10 10:46:46 -0700 (Tue, 10 Jul 2007) Log Message: ----------- remove redundant -D option. Modified Paths: -------------- apple-local/branches/llvm/gcc/Makefile.in Modified: apple-local/branches/llvm/gcc/Makefile.in =================================================================== --- apple-local/branches/llvm/gcc/Makefile.in 2007-07-10 14:49:18 UTC (rev 129260) +++ apple-local/branches/llvm/gcc/Makefile.in 2007-07-10 17:46:46 UTC (rev 129261) @@ -230,7 +230,7 @@ ifeq ($(LLVMOBJDIR),) CPPFLAGS = @CPPFLAGS@ else -CPPFLAGS := @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS $(shell $(LLVMBINPATH)/llvm-config --cppflags) +CPPFLAGS := @CPPFLAGS@ -DENABLE_LLVM $(shell $(LLVMBINPATH)/llvm-config --cppflags) # Use llvm-config to get the srcdir that LLVM was configured with, to support # srcdir != objdir builds. From evan.cheng at apple.com Tue Jul 10 12:50:44 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 17:50:44 -0000 Subject: [llvm-commits] [llvm] r38495 - /llvm/trunk/lib/CodeGen/IfConversion.cpp Message-ID: <200707101750.l6AHolkE008388@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 12:50:43 2007 New Revision: 38495 URL: http://llvm.org/viewvc/llvm-project?rev=38495&view=rev Log: Somehow this wasn't committed last time. M_CLOBBERS_PRED is gone. Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=38495&r1=38494&r2=38495&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Tue Jul 10 12:50:43 2007 @@ -84,7 +84,7 @@ /// 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. - /// ClobbersPredicate- True if BB would modify the predicate (e.g. has + /// ClobbersPred - True if BB could modify predicates (e.g. has /// cmp, call, etc.) /// NonPredSize - Number of non-predicated instructions. /// BB - Corresponding MachineBasicBlock. @@ -588,7 +588,10 @@ return; } - if (TID->Flags & M_CLOBBERS_PRED) + // FIXME: Make use of PredDefs? e.g. ADDC, SUBC sets predicates but are + // still potentially predicable. + std::vector PredDefs; + if (TII->DefinesPredicate(I, PredDefs)) BBI.ClobbersPred = true; if ((TID->Flags & M_PREDICABLE) == 0) { From evan.cheng at apple.com Tue Jul 10 12:52:21 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 17:52:21 -0000 Subject: [llvm-commits] [llvm] r38496 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Message-ID: <200707101752.l6AHqRUJ008448@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 12:52:20 2007 New Revision: 38496 URL: http://llvm.org/viewvc/llvm-project?rev=38496&view=rev Log: If the operand is marked M_OPTIONAL_DEF_OPERAND, then it's a def. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=38496&r1=38495&r2=38496&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Tue Jul 10 12:52:20 2007 @@ -323,7 +323,10 @@ // Get/emit the operand. unsigned VReg = getVR(Op, VRBaseMap); - MI->addRegOperand(VReg, false); + const TargetInstrDescriptor *TID = MI->getInstrDescriptor(); + bool isOptDef = (IIOpNum < TID->numOperands) + ? (TID->OpInfo[IIOpNum].Flags & M_OPTIONAL_DEF_OPERAND) : false; + MI->addRegOperand(VReg, isOptDef); // Verify that it is right. assert(MRegisterInfo::isVirtualRegister(VReg) && "Not a vreg?"); From resistor at mac.com Tue Jul 10 12:59:22 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 17:59:22 -0000 Subject: [llvm-commits] [llvm] r38497 - in /llvm/trunk: include/llvm/Analysis/MemoryDependenceAnalysis.h lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200707101759.l6AHxbnT008630@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 12:59:22 2007 New Revision: 38497 URL: http://llvm.org/viewvc/llvm-project?rev=38497&view=rev Log: Add support for finding the dependencies of call and invoke instructions. Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=38497&r1=38496&r2=38497&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Tue Jul 10 12:59:22 2007 @@ -18,6 +18,7 @@ #define LLVM_ANALYSIS_MEMORY_DEPENDENCE_H #include "llvm/Pass.h" +#include "llvm/Support/CallSite.h" #include "llvm/ADT/DenseMap.h" #include "llvm/Support/Compiler.h" #include @@ -34,6 +35,7 @@ DenseMap > depGraphLocal; std::multimap reverseDep; + Instruction* getCallSiteDependency(CallSite C, bool local = true); public: static Instruction* NonLocal; Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=38497&r1=38496&r2=38497&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 10 12:59:22 2007 @@ -40,6 +40,61 @@ AU.addRequiredTransitive(); } +// Find the dependency of a CallSite +Instruction* MemoryDependenceAnalysis::getCallSiteDependency(CallSite C, bool local) { + assert(local && "Non-local memory dependence analysis not yet implemented"); + + AliasAnalysis& AA = getAnalysis(); + TargetData& TD = getAnalysis(); + BasicBlock::iterator blockBegin = C.getInstruction()->getParent()->begin(); + BasicBlock::iterator QI = C.getInstruction(); + + 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(QI)) { + pointer = S->getPointerOperand(); + pointerSize = TD.getTypeSize(S->getOperand(0)->getType()); + } else if (LoadInst* L = dyn_cast(QI)) { + pointer = L->getPointerOperand(); + pointerSize = TD.getTypeSize(L->getType()); + } else if (AllocationInst* AI = dyn_cast(QI)) { + pointer = AI; + if (ConstantInt* C = dyn_cast(AI->getArraySize())) + pointerSize = C->getZExtValue(); + else + pointerSize = ~0UL; + } else if (FreeInst* F = dyn_cast(QI)) { + pointer = F->getPointerOperand(); + + // FreeInsts erase the entire structure + pointerSize = ~0UL; + } else if (CallSite::get(QI).getInstruction() != 0) { + if (AA.getModRefInfo(C, CallSite::get(QI)) != AliasAnalysis::NoModRef) { + depGraphLocal.insert(std::make_pair(C.getInstruction(), std::make_pair(QI, true))); + reverseDep.insert(std::make_pair(QI, C.getInstruction())); + return QI; + } else { + continue; + } + } + + if (AA.getModRefInfo(C, pointer, pointerSize) != AliasAnalysis::NoModRef) { + depGraphLocal.insert(std::make_pair(C.getInstruction(), std::make_pair(QI, true))); + reverseDep.insert(std::make_pair(QI, C.getInstruction())); + return QI; + } + } + + // No dependence found + depGraphLocal.insert(std::make_pair(C.getInstruction(), std::make_pair(NonLocal, true))); + reverseDep.insert(std::make_pair(NonLocal, C.getInstruction())); + return NonLocal; +} + /// getDependency - Return the instruction on which a memory operation /// depends. The local paramter indicates if the query should only /// evaluate dependencies within the same basic block. @@ -77,13 +132,13 @@ // FreeInsts erase the entire structure, not just a field dependeeSize = ~0UL; - } else if (isa(query)) + } else if (CallSite::get(QI).getInstruction() != 0) + return getCallSiteDependency(CallSite::get(QI)); + else if (isa(query)) return None; else - // FIXME: Call/InvokeInsts need proper handling return None; - BasicBlock::iterator blockBegin = query->getParent()->begin(); while (QI != blockBegin) { @@ -109,21 +164,13 @@ // FreeInsts erase the entire structure pointerSize = ~0UL; - } else if (CallInst* C = dyn_cast(QI)) { + } else if (CallSite::get(QI).getInstruction() != 0) { // Call insts need special handling. Check is they can modify our pointer - if (AA.getModRefInfo(C, dependee, dependeeSize) != AliasAnalysis::NoModRef) { - depGraphLocal.insert(std::make_pair(query, std::make_pair(C, true))); - reverseDep.insert(std::make_pair(C, query)); - return C; - } else { - continue; - } - } else if (InvokeInst* I = dyn_cast(QI)) { - // Invoke insts need special handling. Check is they can modify our pointer - if (AA.getModRefInfo(I, dependee, dependeeSize) != AliasAnalysis::NoModRef) { - depGraphLocal.insert(std::make_pair(query, std::make_pair(I, true))); - reverseDep.insert(std::make_pair(I, query)); - return I; + if (AA.getModRefInfo(CallSite::get(QI), dependee, dependeeSize) != + AliasAnalysis::NoModRef) { + depGraphLocal.insert(std::make_pair(query, std::make_pair(QI, true))); + reverseDep.insert(std::make_pair(QI, query)); + return QI; } else { continue; } From evan.cheng at apple.com Tue Jul 10 13:05:01 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 18:05:01 -0000 Subject: [llvm-commits] [llvm] r38498 - in /llvm/trunk/utils/TableGen: CodeGenInstruction.h CodeGenTarget.cpp InstrInfoEmitter.cpp Message-ID: <200707101805.l6AI54Dl008842@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 13:05:01 2007 New Revision: 38498 URL: http://llvm.org/viewvc/llvm-project?rev=38498&view=rev Log: Try committing again. Add OptionalDefOperand. Remove clobbersPred. Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h llvm/trunk/utils/TableGen/CodeGenTarget.cpp llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=38498&r1=38497&r2=38498&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Tue Jul 10 13:05:01 2007 @@ -97,8 +97,8 @@ bool hasVariableNumberOfOperands; bool hasCtrlDep; bool noResults; - bool clobbersPred; bool isNotDuplicable; + bool hasOptionalDef; /// ParseOperandName - Parse an operand name like "$foo" or "$foo.bar", /// where $foo is a whole operand and $foo.bar refers to a suboperand. Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=38498&r1=38497&r2=38498&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Tue Jul 10 13:05:01 2007 @@ -370,8 +370,8 @@ usesCustomDAGSchedInserter = R->getValueAsBit("usesCustomDAGSchedInserter"); hasCtrlDep = R->getValueAsBit("hasCtrlDep"); noResults = R->getValueAsBit("noResults"); - clobbersPred = R->getValueAsBit("clobbersPred"); isNotDuplicable = R->getValueAsBit("isNotDuplicable"); + hasOptionalDef = false; hasVariableNumberOfOperands = false; DagInit *DI; @@ -411,9 +411,10 @@ if (unsigned NumArgs = MIOpInfo->getNumArgs()) NumOps = NumArgs; - if (Rec->isSubClassOf("PredicateOperand")) { + if (Rec->isSubClassOf("PredicateOperand")) isPredicable = true; - } + else if (Rec->isSubClassOf("OptionalDefOperand")) + hasOptionalDef = true; } else if (Rec->getName() == "variable_ops") { hasVariableNumberOfOperands = true; continue; Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=38498&r1=38497&r2=38498&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Tue Jul 10 13:05:01 2007 @@ -110,6 +110,11 @@ if (Inst.OperandList[i].Rec->isSubClassOf("PredicateOperand")) Res += "|M_PREDICATE_OPERAND"; + // Optional def operands. Check to see if the original unexpanded operand + // was of type OptionalDefOperand. + if (Inst.OperandList[i].Rec->isSubClassOf("OptionalDefOperand")) + Res += "|M_OPTIONAL_DEF_OPERAND"; + // Fill in constraint info. Res += ", " + Inst.OperandList[i].Constraints[j]; Result.push_back(Res); @@ -241,8 +246,8 @@ if (Inst.isCommutable) OS << "|M_COMMUTABLE"; if (Inst.isTerminator) OS << "|M_TERMINATOR_FLAG"; if (Inst.isReMaterializable) OS << "|M_REMATERIALIZIBLE"; - if (Inst.clobbersPred) OS << "|M_CLOBBERS_PRED"; if (Inst.isNotDuplicable) OS << "|M_NOT_DUPLICABLE"; + if (Inst.hasOptionalDef) OS << "|M_HAS_OPTIONAL_DEF"; if (Inst.usesCustomDAGSchedInserter) OS << "|M_USES_CUSTOM_DAG_SCHED_INSERTION"; if (Inst.hasVariableNumberOfOperands) From evan.cheng at apple.com Tue Jul 10 13:06:29 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 18:06:29 -0000 Subject: [llvm-commits] [llvm] r38499 - /llvm/trunk/include/llvm/Target/TargetInstrInfo.h Message-ID: <200707101806.l6AI6UCN008910@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 13:06:29 2007 New Revision: 38499 URL: http://llvm.org/viewvc/llvm-project?rev=38499&view=rev Log: Add OptionalDefOperand. Remove clobbersPred. Also add DefinesPredicate to be used by if-converter. Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=38499&r1=38498&r2=38499&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Tue Jul 10 13:06:29 2007 @@ -82,13 +82,13 @@ // at any time, e.g. constant generation, load from constant pool. const unsigned M_REMATERIALIZIBLE = 1 << 13; -// M_CLOBBERS_PRED - Set if this instruction may clobbers the condition code -// register and / or registers that are used to predicate instructions. -const unsigned M_CLOBBERS_PRED = 1 << 14; - // M_NOT_DUPLICABLE - Set if this instruction cannot be safely duplicated. // (e.g. instructions with unique labels attached). -const unsigned M_NOT_DUPLICABLE = 1 << 15; +const unsigned M_NOT_DUPLICABLE = 1 << 14; + +// M_HAS_OPTIONAL_DEF - Set if this instruction has an optional definition, e.g. +// ARM instructions which can set condition code if 's' bit is set. +const unsigned M_HAS_OPTIONAL_DEF = 1 << 15; // Machine operand flags // M_LOOK_UP_PTR_REG_CLASS - Set if this operand is a pointer value and it @@ -99,6 +99,10 @@ /// predicate operand that controls an M_PREDICATED instruction. const unsigned M_PREDICATE_OPERAND = 1 << 1; +/// M_OPTIONAL_DEF_OPERAND - Set if this operand is a optional def. +/// +const unsigned M_OPTIONAL_DEF_OPERAND = 1 << 2; + namespace TOI { // Operand constraints: only "tied_to" for now. enum OperandConstraint { @@ -264,14 +268,14 @@ return get(Opcode).Flags & M_PREDICABLE; } - bool clobbersPredicate(MachineOpCode Opcode) const { - return get(Opcode).Flags & M_CLOBBERS_PRED; - } - bool isNotDuplicable(MachineOpCode Opcode) const { return get(Opcode).Flags & M_NOT_DUPLICABLE; } + bool hasOptionalDef(MachineOpCode Opcode) const { + return get(Opcode).Flags & M_HAS_OPTIONAL_DEF; + } + /// isTriviallyReMaterializable - Return true if the instruction is trivially /// rematerializable, meaning it has no side effects and requires no operands /// that aren't always available. @@ -452,6 +456,14 @@ 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 &Pred) const { + return false; + } + /// getPointerRegClass - Returns a TargetRegisterClass used for pointer /// values. virtual const TargetRegisterClass *getPointerRegClass() const { From evan.cheng at apple.com Tue Jul 10 13:07:08 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 18:07:08 -0000 Subject: [llvm-commits] [llvm] r38500 - /llvm/trunk/lib/Target/Target.td Message-ID: <200707101807.l6AI78HY008944@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 13:07:08 2007 New Revision: 38500 URL: http://llvm.org/viewvc/llvm-project?rev=38500&view=rev Log: Remove clobbersPred. Modified: llvm/trunk/lib/Target/Target.td Modified: llvm/trunk/lib/Target/Target.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Target.td?rev=38500&r1=38499&r2=38500&view=diff ============================================================================== --- llvm/trunk/lib/Target/Target.td (original) +++ llvm/trunk/lib/Target/Target.td Tue Jul 10 13:07:08 2007 @@ -192,7 +192,6 @@ bit usesCustomDAGSchedInserter = 0; // Pseudo instr needing special help. bit hasCtrlDep = 0; // Does this instruction r/w ctrl-flow chains? bit noResults = 0; // Does this instruction produce no results? - bit clobbersPred = 0; // Does it clobbers condition code / predicate? bit isNotDuplicable = 0; // Is it unsafe to duplicate this instruction? InstrItinClass Itinerary = NoItinerary;// Execution steps used for scheduling. From evan.cheng at apple.com Tue Jul 10 13:08:01 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 18:08:01 -0000 Subject: [llvm-commits] [llvm] r38501 - in /llvm/trunk/lib/Target/ARM: ARMISelDAGToDAG.cpp ARMInstrInfo.cpp ARMInstrInfo.h ARMInstrInfo.td ARMInstrThumb.td ARMInstrVFP.td ARMLoadStoreOptimizer.cpp ARMRegisterInfo.cpp Message-ID: <200707101808.l6AI82Ll008996@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 13:08:01 2007 New Revision: 38501 URL: http://llvm.org/viewvc/llvm-project?rev=38501&view=rev Log: Remove clobbersPred. Add an OptionalDefOperand to instructions which have the 's' bit. Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.h llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/ARMInstrThumb.td llvm/trunk/lib/Target/ARM/ARMInstrVFP.td llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=38501&r1=38500&r2=38501&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jul 10 13:08:01 2007 @@ -586,8 +586,9 @@ CurDAG->getTargetConstant(0, MVT::i32)); else { SDOperand Ops[] = { TFI, CurDAG->getTargetConstant(0, MVT::i32), - getAL(CurDAG), CurDAG->getRegister(0, MVT::i32) }; - return CurDAG->SelectNodeTo(N, ARM::ADDri, MVT::i32, Ops, 4); + 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: { @@ -619,10 +620,9 @@ 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) - - }; - return CurDAG->SelectNodeTo(N, ARM::ADDrs, MVT::i32, Ops, 6); + 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); @@ -631,8 +631,8 @@ SDOperand Ops[] = { V, V, CurDAG->getRegister(0, MVT::i32), CurDAG->getTargetConstant(ShImm, MVT::i32), getAL(CurDAG), CurDAG->getRegister(0, MVT::i32), - }; - return CurDAG->SelectNodeTo(N, ARM::RSBrs, MVT::i32, Ops, 6); + CurDAG->getRegister(0, MVT::i32) }; + return CurDAG->SelectNodeTo(N, ARM::RSBrs, MVT::i32, Ops, 7); } } break; @@ -645,15 +645,17 @@ AddToISelQueue(Op.getOperand(0)); AddToISelQueue(Op.getOperand(1)); SDOperand Ops[] = { Op.getOperand(0), Op.getOperand(1), - getAL(CurDAG), CurDAG->getRegister(0, MVT::i32) }; - return CurDAG->getTargetNode(ARM::UMULL, MVT::i32, MVT::i32, Ops, 4); + getAL(CurDAG), CurDAG->getRegister(0, MVT::i32), + CurDAG->getRegister(0, MVT::i32) }; + return CurDAG->getTargetNode(ARM::UMULL, MVT::i32, MVT::i32, Ops, 5); } case ARMISD::MULHILOS: { AddToISelQueue(Op.getOperand(0)); AddToISelQueue(Op.getOperand(1)); SDOperand Ops[] = { Op.getOperand(0), Op.getOperand(1), - getAL(CurDAG), CurDAG->getRegister(0, MVT::i32) }; - return CurDAG->getTargetNode(ARM::SMULL, MVT::i32, MVT::i32, Ops, 4); + 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(Op); Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp?rev=38501&r1=38500&r2=38501&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Tue Jul 10 13:08:01 2007 @@ -214,15 +214,18 @@ // add more than 1 instruction. Abandon! return NULL; UpdateMI = BuildMI(get(isSub ? ARM::SUBri : ARM::ADDri), WBReg) - .addReg(BaseReg).addImm(SOImmVal).addImm(Pred); + .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(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(BaseReg).addReg(OffReg) + .addImm(Pred).addReg(0).addReg(0); break; } case ARMII::AddrMode3 : { @@ -231,10 +234,12 @@ 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(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(BaseReg).addReg(OffReg) + .addImm(Pred).addReg(0).addReg(0); break; } } @@ -495,6 +500,25 @@ } } +bool ARMInstrInfo::DefinesPredicate(MachineInstr *MI, + std::vector &Pred) const { + const TargetInstrDescriptor *TID = MI->getInstrDescriptor(); + if (!TID->ImplicitDefs && (TID->Flags & M_HAS_OPTIONAL_DEF) == 0) + return false; + + bool Found = false; + for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { + const MachineOperand &MO = MI->getOperand(i); + if (MO.isReg() && 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 &JT, unsigned JTI) DISABLE_INLINE; Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=38501&r1=38500&r2=38501&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Tue Jul 10 13:08:01 2007 @@ -113,6 +113,9 @@ virtual bool SubsumesPredicate(const std::vector &Pred1, const std::vector &Pred1) const; + + virtual bool DefinesPredicate(MachineInstr *MI, + std::vector &Pred) const; }; // Utility routines Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=38501&r1=38500&r2=38501&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Jul 10 13:08:01 2007 @@ -380,10 +380,25 @@ list Predicates = [IsARM]; } +// Same as I except it can optionally modify CPSR. +class sI pattern> + // FIXME: Set all opcodes to 0 for now. + : InstARM<0, am, sz, im, cstr> { + let OperandList = !con(oprnds, (ops pred:$p, cc_out:$s)); + let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm)); + let Pattern = pattern; + list Predicates = [IsARM]; +} + class AI pattern> : I; +class AsI pattern> + : sI; class AI1 pattern> : I; +class AsI1 pattern> + : sI; class AI2 pattern> : I; class AI3 pattern> @@ -412,21 +427,21 @@ /// AI1_bin_irs - Defines a set of (op r, {so_imm|r|so_reg}) patterns for a /// binop that produces a value. -multiclass AI1_bin_irs { - def ri : AI1<(ops GPR:$dst, GPR:$a, so_imm:$b), +multiclass AsI1_bin_irs { + def ri : AsI1<(ops GPR:$dst, GPR:$a, so_imm:$b), opc, " $dst, $a, $b", [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>; - def rr : AI1<(ops GPR:$dst, GPR:$a, GPR:$b), + def rr : AsI1<(ops GPR:$dst, GPR:$a, GPR:$b), opc, " $dst, $a, $b", [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>; - def rs : AI1<(ops GPR:$dst, GPR:$a, so_reg:$b), + def rs : AsI1<(ops GPR:$dst, GPR:$a, so_reg:$b), opc, " $dst, $a, $b", [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>; } -/// AI1_bin_s_irs - Similar to AI1_bin_irs except it sets the 's' bit so the +/// ASI1_bin_s_irs - Similar to AsI1_bin_irs except it sets the 's' bit so the /// instruction modifies the CSPR register. -multiclass AI1_bin_s_irs { +multiclass ASI1_bin_s_irs { def ri : AI1<(ops GPR:$dst, GPR:$a, so_imm:$b), opc, "s $dst, $a, $b", [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>, Imp<[], [CPSR]>; @@ -439,7 +454,7 @@ } /// AI1_cmp_irs - Defines a set of (op r, {so_imm|r|so_reg}) cmp / test -/// patterns. Similar to AI1_bin_irs except the instruction does not produce +/// patterns. Similar to AsI1_bin_irs except the instruction does not produce /// a explicit result, only implicitly set CPSR. multiclass AI1_cmp_irs { def ri : AI1<(ops GPR:$a, so_imm:$b), @@ -453,30 +468,6 @@ [(opnode GPR:$a, so_reg:$b)]>, Imp<[], [CPSR]>; } -/// AI1_bin_is - Defines a set of (op r, {so_imm|so_reg}) patterns for a binop. -multiclass AI1_bin_is { - def ri : AI1<(ops GPR:$dst, GPR:$a, so_imm:$b), - opc, " $dst, $a, $b", - [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>; - def rs : AI1<(ops GPR:$dst, GPR:$a, so_reg:$b), - opc, " $dst, $a, $b", - [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>; -} - -/// AI1_unary_irs - Defines a set of (op {so_imm|r|so_reg}) patterns for unary -/// ops. -multiclass AI1_unary_irs { - def i : AI1<(ops GPR:$dst, so_imm:$a), - opc, " $dst, $a", - [(set GPR:$dst, (opnode so_imm:$a))]>; - def r : AI1<(ops GPR:$dst, GPR:$a), - opc, " $dst, $a", - [(set GPR:$dst, (opnode GPR:$a))]>; - def s : AI1<(ops GPR:$dst, so_reg:$a), - opc, " $dst, $a", - [(set GPR:$dst, (opnode so_reg:$a))]>; -} - /// 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 { @@ -536,17 +527,17 @@ class JTI2 pattern> : XI; -/// AXI1_bin_c_irs - Same as AI1_bin_irs but without the predicate operand and -/// setting carry bit. -multiclass AXI1_bin_c_irs { - def ri : AXI1<(ops GPR:$dst, GPR:$a, so_imm:$b), - !strconcat(opc, " $dst, $a, $b"), +/// AsXI1_bin_c_irs - Same as AsI1_bin_irs but without the predicate operand and +/// setting carry bit. But it can optionally set CPSR. +multiclass AsXI1_bin_c_irs { + def ri : AXI1<(ops GPR:$dst, GPR:$a, so_imm:$b, cc_out:$s), + !strconcat(opc, "${s} $dst, $a, $b"), [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>, Imp<[CPSR], []>; - def rr : AXI1<(ops GPR:$dst, GPR:$a, GPR:$b), - !strconcat(opc, " $dst, $a, $b"), + def rr : AXI1<(ops GPR:$dst, GPR:$a, GPR:$b, cc_out:$s), + !strconcat(opc, "${s} $dst, $a, $b"), [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>, Imp<[CPSR], []>; - def rs : AXI1<(ops GPR:$dst, GPR:$a, so_reg:$b), - !strconcat(opc, " $dst, $a, $b"), + def rs : AXI1<(ops GPR:$dst, GPR:$a, so_reg:$b, cc_out:$s), + !strconcat(opc, "${s} $dst, $a, $b"), [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>, Imp<[CPSR], []>; } @@ -649,7 +640,7 @@ "ldm${p}${addr:submode} $addr, $dst1", []>; -let isCall = 1, noResults = 1, clobbersPred = 1, +let isCall = 1, noResults = 1, Defs = [R0, R1, R2, R3, R12, LR, D0, D1, D2, D3, D4, D5, D6, D7, CPSR] in { def BL : AXI<(ops i32imm:$func, variable_ops), @@ -697,7 +688,7 @@ // 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<(ops brtarget:$dst), "b", " $dst", - [/*(ARMbrcond bb:$dst, imm:$cc, CCR:$ccr)*/]>; + [/*(ARMbrcond bb:$dst, imm:$cc, CCR:$ccr)*/]>; } //===----------------------------------------------------------------------===// @@ -840,29 +831,28 @@ // Move Instructions. // -def MOVr : AI1<(ops GPR:$dst, GPR:$src), - "mov", " $dst, $src", []>; -def MOVs : AI1<(ops GPR:$dst, so_reg:$src), - "mov", " $dst, $src", [(set GPR:$dst, so_reg:$src)]>; +def MOVr : AsI1<(ops GPR:$dst, GPR:$src), + "mov", " $dst, $src", []>; +def MOVs : AsI1<(ops GPR:$dst, so_reg:$src), + "mov", " $dst, $src", [(set GPR:$dst, so_reg:$src)]>; let isReMaterializable = 1 in -def MOVi : AI1<(ops GPR:$dst, so_imm:$src), - "mov", " $dst, $src", [(set GPR:$dst, so_imm:$src)]>; +def MOVi : AsI1<(ops GPR:$dst, so_imm:$src), + "mov", " $dst, $src", [(set GPR:$dst, so_imm:$src)]>; + +def MOVrx : AsI1<(ops GPR:$dst, GPR:$src), + "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 clobbersPred = 1 in { def MOVsrl_flag : AI1<(ops GPR:$dst, GPR:$src), "mov", "s $dst, $src, lsr #1", [(set GPR:$dst, (ARMsrl_flag GPR:$src))]>, Imp<[], [CPSR]>; def MOVsra_flag : AI1<(ops GPR:$dst, GPR:$src), "mov", "s $dst, $src, asr #1", [(set GPR:$dst, (ARMsra_flag GPR:$src))]>, Imp<[], [CPSR]>; -} -def MOVrx : AI1<(ops GPR:$dst, GPR:$src), - "mov", " $dst, $src, rrx", - [(set GPR:$dst, (ARMrrx GPR:$src))]>; //===----------------------------------------------------------------------===// // Extend Instructions. @@ -907,38 +897,40 @@ // Arithmetic Instructions. // -defm ADD : AI1_bin_irs<"add", BinOpFrag<(add node:$LHS, node:$RHS)>>; -defm SUB : AI1_bin_irs<"sub", BinOpFrag<(sub node:$LHS, node:$RHS)>>; +defm ADD : AsI1_bin_irs<"add", BinOpFrag<(add node:$LHS, node:$RHS)>>; +defm SUB : AsI1_bin_irs<"sub", BinOpFrag<(sub node:$LHS, node:$RHS)>>; // ADD and SUB with 's' bit set. -let clobbersPred = 1 in { -defm ADDS : AI1_bin_s_irs<"add", BinOpFrag<(addc node:$LHS, node:$RHS)>>; -defm SUBS : AI1_bin_s_irs<"sub", BinOpFrag<(subc node:$LHS, node:$RHS)>>; -} +defm ADDS : ASI1_bin_s_irs<"add", BinOpFrag<(addc node:$LHS, node:$RHS)>>; +defm SUBS : ASI1_bin_s_irs<"sub", BinOpFrag<(subc node:$LHS, node:$RHS)>>; // FIXME: Do not allow ADC / SBC to be predicated for now. -defm ADC : AXI1_bin_c_irs<"adc", BinOpFrag<(adde node:$LHS, node:$RHS)>>; -defm SBC : AXI1_bin_c_irs<"sbc", BinOpFrag<(sube node:$LHS, node:$RHS)>>; +defm ADC : AsXI1_bin_c_irs<"adc", BinOpFrag<(adde node:$LHS, node:$RHS)>>; +defm SBC : AsXI1_bin_c_irs<"sbc", BinOpFrag<(sube node:$LHS, node:$RHS)>>; // These don't define reg/reg forms, because they are handled above. -defm RSB : AI1_bin_is <"rsb", BinOpFrag<(sub node:$RHS, node:$LHS)>>; +def RSBri : AsI1<(ops GPR:$dst, GPR:$a, so_imm:$b), + "rsb", " $dst, $a, $b", + [(set GPR:$dst, (sub so_imm:$b, GPR:$a))]>; + +def RSBrs : AsI1<(ops GPR:$dst, GPR:$a, so_reg:$b), + "rsb", " $dst, $a, $b", + [(set GPR:$dst, (sub so_reg:$b, GPR:$a))]>; // RSB with 's' bit set. -let clobbersPred = 1 in { def RSBSri : AI1<(ops GPR:$dst, GPR:$a, so_imm:$b), "rsb", "s $dst, $a, $b", [(set GPR:$dst, (subc so_imm:$b, GPR:$a))]>, Imp<[], [CPSR]>; def RSBSrs : AI1<(ops GPR:$dst, GPR:$a, so_reg:$b), "rsb", "s $dst, $a, $b", [(set GPR:$dst, (subc so_reg:$b, GPR:$a))]>, Imp<[], [CPSR]>; -} -// FIXME: Do not allow RSC to be predicated for now. -def RSCri : AXI1<(ops GPR:$dst, GPR:$a, so_imm:$b), - "rsc $dst, $a, $b", +// FIXME: Do not allow RSC to be predicated for now. But they can set CPSR. +def RSCri : AXI1<(ops GPR:$dst, GPR:$a, so_imm:$b, cc_out:$s), + "rsc${s} $dst, $a, $b", [(set GPR:$dst, (sube so_imm:$b, GPR:$a))]>, Imp<[CPSR], []>; -def RSCrs : AXI1<(ops GPR:$dst, GPR:$a, so_reg:$b), - "rsc $dst, $a, $b", +def RSCrs : AXI1<(ops GPR:$dst, GPR:$a, so_reg:$b, cc_out:$s), + "rsc${s} $dst, $a, $b", [(set GPR:$dst, (sube so_reg:$b, GPR:$a))]>, Imp<[CPSR], []>; // (sub X, imm) gets canonicalized to (add X, -imm). Match this form. @@ -961,18 +953,18 @@ // Bitwise Instructions. // -defm AND : AI1_bin_irs<"and", BinOpFrag<(and node:$LHS, node:$RHS)>>; -defm ORR : AI1_bin_irs<"orr", BinOpFrag<(or node:$LHS, node:$RHS)>>; -defm EOR : AI1_bin_irs<"eor", BinOpFrag<(xor node:$LHS, node:$RHS)>>; -defm BIC : AI1_bin_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>; - -def MVNr : AI<(ops GPR:$dst, GPR:$src), - "mvn", " $dst, $src", [(set GPR:$dst, (not GPR:$src))]>; -def MVNs : AI<(ops GPR:$dst, so_reg:$src), - "mvn", " $dst, $src", [(set GPR:$dst, (not so_reg:$src))]>; +defm AND : AsI1_bin_irs<"and", BinOpFrag<(and node:$LHS, node:$RHS)>>; +defm ORR : AsI1_bin_irs<"orr", BinOpFrag<(or node:$LHS, node:$RHS)>>; +defm EOR : AsI1_bin_irs<"eor", BinOpFrag<(xor node:$LHS, node:$RHS)>>; +defm BIC : AsI1_bin_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>; + +def MVNr : AsI<(ops GPR:$dst, GPR:$src), + "mvn", " $dst, $src", [(set GPR:$dst, (not GPR:$src))]>; +def MVNs : AsI<(ops GPR:$dst, so_reg:$src), + "mvn", " $dst, $src", [(set GPR:$dst, (not so_reg:$src))]>; let isReMaterializable = 1 in -def MVNi : AI<(ops GPR:$dst, so_imm:$imm), - "mvn", " $dst, $imm", [(set GPR:$dst, so_imm_not:$imm)]>; +def MVNi : AsI<(ops GPR:$dst, so_imm:$imm), + "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)>; @@ -981,46 +973,42 @@ // Multiply Instructions. // -// AI_orr - Defines a (op r, r) pattern. -class AI_orr - : AI<(ops GPR:$dst, GPR:$a, GPR:$b), - opc, " $dst, $a, $b", - [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>; - -// AI_oorr - Defines a (op (op r, r), r) pattern. -class AI_oorr - : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$c), - opc, " $dst, $a, $b, $c", - [(set GPR:$dst, (opnode1 (opnode2 GPR:$a, GPR:$b), GPR:$c))]>; - -def MUL : AI_orr<"mul", mul>; -def MLA : AI_oorr<"mla", add, mul>; +def MUL : AsI<(ops GPR:$dst, GPR:$a, GPR:$b), + "mul", " $dst, $a, $b", + [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; + +def MLA : AsI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$c), + "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 : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), - "smull", " $ldst, $hdst, $a, $b", - []>; +def SMULL : AsI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), + "smull", " $ldst, $hdst, $a, $b", []>; -def UMULL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), - "umull", " $ldst, $hdst, $a, $b", - []>; +def UMULL : AsI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), + "umull", " $ldst, $hdst, $a, $b", []>; // Multiply + accumulate -def SMLAL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), - "smlal", " $ldst, $hdst, $a, $b", - []>; +def SMLAL : AsI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), + "smlal", " $ldst, $hdst, $a, $b", []>; -def UMLAL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), - "umlal", " $ldst, $hdst, $a, $b", - []>; +def UMLAL : AsI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), + "umlal", " $ldst, $hdst, $a, $b", []>; def UMAAL : AI<(ops GPR:$ldst, GPR:$hdst, GPR:$a, GPR:$b), - "umaal", " $ldst, $hdst, $a, $b", - []>, Requires<[IsARM, HasV6]>; + "umaal", " $ldst, $hdst, $a, $b", []>, + Requires<[IsARM, HasV6]>; // Most significant word multiply -def SMMUL : AI_orr<"smmul", mulhs>, Requires<[IsARM, HasV6]>; -def SMMLA : AI_oorr<"smmla", add, mulhs>, Requires<[IsARM, HasV6]>; +def SMMUL : AI<(ops GPR:$dst, GPR:$a, GPR:$b), + "smmul", " $dst, $a, $b", + [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>, + Requires<[IsARM, HasV6]>; + +def SMMLA : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$c), + "smmla", " $dst, $a, $b, $c", + [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR:$c))]>, + Requires<[IsARM, HasV6]>; def SMMLS : AI<(ops GPR:$dst, GPR:$a, GPR:$b, GPR:$c), @@ -1164,7 +1152,6 @@ // Comparison Instructions... // -let clobbersPred = 1 in { defm CMP : AI1_cmp_irs<"cmp", BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>>; defm CMN : AI1_cmp_irs<"cmn", BinOpFrag<(ARMcmp node:$LHS,(ineg node:$RHS))>>; @@ -1174,7 +1161,6 @@ defm CMPnz : AI1_cmp_irs<"cmp", BinOpFrag<(ARMcmpNZ node:$LHS, node:$RHS)>>; defm CMNnz : AI1_cmp_irs<"cmn", BinOpFrag<(ARMcmpNZ node:$LHS,(ineg node:$RHS))>>; -} def : ARMPat<(ARMcmp GPR:$src, so_imm_neg:$imm), (CMNri GPR:$src, so_imm_neg:$imm)>; @@ -1223,8 +1209,8 @@ // // __aeabi_read_tp preserves the registers r1-r3. -let isCall = 1, clobbersPred = 1, - Defs = [R0, R12, LR] in { +let isCall = 1, + Defs = [R0, R12, LR, CPSR] in { def TPsoft : AXI<(ops), "bl __aeabi_read_tp", [(set R0, ARMthread_pointer)]>; Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=38501&r1=38500&r2=38501&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Tue Jul 10 13:08:01 2007 @@ -33,7 +33,6 @@ string asm, string cstr, list pattern> // FIXME: Set all opcodes to 0 for now. : InstARM<0, am, sz, IndexModeNone, cstr> { - let clobbersPred = 1; let OperandList = ops; let AsmString = asm; let Pattern = pattern; Modified: llvm/trunk/lib/Target/ARM/ARMInstrVFP.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrVFP.td?rev=38501&r1=38500&r2=38501&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrVFP.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrVFP.td Tue Jul 10 13:08:01 2007 @@ -275,7 +275,6 @@ // FMSRR: GPR -> SPR -let clobbersPred = 1 in def FMSTAT : ASI<(ops), "fmstat", "", [(arm_fmstat)]>, Imp<[], [CPSR]>; // FMXR: GPR -> VFP Sstem reg Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=38501&r1=38500&r2=38501&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Tue Jul 10 13:08:01 2007 @@ -158,7 +158,7 @@ BuildMI(MBB, MBBI, TII->get(BaseOpc), NewBase) .addReg(Base, false, false, BaseKill).addImm(ImmedOffset) - .addImm(Pred).addReg(PredReg); + .addImm(Pred).addReg(PredReg).addReg(0); Base = NewBase; BaseKill = true; // New base is always killed right its use. } Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp?rev=38501&r1=38500&r2=38501&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp Tue Jul 10 13:08:01 2007 @@ -191,7 +191,7 @@ BuildMI(MBB, I, TII.get(ARM::tMOVr), DestReg).addReg(SrcReg); else BuildMI(MBB, I, TII.get(ARM::MOVr), DestReg).addReg(SrcReg) - .addImm((int64_t)ARMCC::AL).addReg(0); + .addImm((int64_t)ARMCC::AL).addReg(0).addReg(0); } else if (RC == ARM::SPRRegisterClass) BuildMI(MBB, I, TII.get(ARM::FCPYS), DestReg).addReg(SrcReg) .addImm((int64_t)ARMCC::AL).addReg(0); @@ -258,6 +258,9 @@ 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).getImmedValue(); unsigned PredReg = MI->getOperand(3).getReg(); if (OpNum == 0) { // move -> store @@ -454,7 +457,7 @@ // 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, false); + .addImm((unsigned)Pred).addReg(PredReg).addReg(0); BaseReg = DestReg; } } @@ -1380,7 +1383,7 @@ MachineInstrBuilder MIB = BuildMI(MBB, MBBI, TII.get(isThumb ? ARM::tADDrSPi : ARM::ADDri),FramePtr) .addFrameIndex(FramePtrSpillFI).addImm(0); - if (!isThumb) MIB.addImm(ARMCC::AL).addReg(0); + if (!isThumb) MIB.addImm(ARMCC::AL).addReg(0).addReg(0); } if (!isThumb) { @@ -1496,10 +1499,11 @@ hasFP(MF)) if (NumBytes) BuildMI(MBB, MBBI, TII.get(ARM::SUBri), ARM::SP).addReg(FramePtr) - .addImm(NumBytes).addImm((unsigned)ARMCC::AL).addReg(0); + .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); + .addImm((unsigned)ARMCC::AL).addReg(0).addReg(0); } else if (NumBytes) { emitSPUpdate(MBB, MBBI, NumBytes, ARMCC::AL, 0, false, TII); } From resistor at mac.com Tue Jul 10 13:11:43 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 18:11:43 -0000 Subject: [llvm-commits] [llvm] r38502 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200707101811.l6AIBsmE009113@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 13:11:42 2007 New Revision: 38502 URL: http://llvm.org/viewvc/llvm-project?rev=38502&view=rev Log: Volatile loads and stores depend on each other. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=38502&r1=38501&r2=38502&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 10 13:11:42 2007 @@ -121,12 +121,15 @@ // 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(QI)) { dependee = S->getPointerOperand(); dependeeSize = TD.getTypeSize(S->getOperand(0)->getType()); + queryIsVolatile = S->isVolatile(); } else if (LoadInst* L = dyn_cast(QI)) { dependee = L->getPointerOperand(); dependeeSize = TD.getTypeSize(L->getType()); + queryIsVolatile = L->isVolatile(); } else if (FreeInst* F = dyn_cast(QI)) { dependee = F->getPointerOperand(); @@ -148,9 +151,23 @@ Value* pointer = 0; uint64_t pointerSize = 0; if (StoreInst* S = dyn_cast(QI)) { + // All volatile loads/stores depend on each other + if (queryIsVolatile && S->isVolatile()) { + depGraphLocal.insert(std::make_pair(query, std::make_pair(S, true))); + reverseDep.insert(std::make_pair(S, query)); + return S; + } + pointer = S->getPointerOperand(); pointerSize = TD.getTypeSize(S->getOperand(0)->getType()); } else if (LoadInst* L = dyn_cast(QI)) { + // All volatile loads/stores depend on each other + if (queryIsVolatile && L->isVolatile()) { + depGraphLocal.insert(std::make_pair(query, std::make_pair(L, true))); + reverseDep.insert(std::make_pair(L, query)); + return L; + } + pointer = L->getPointerOperand(); pointerSize = TD.getTypeSize(L->getType()); } else if (AllocationInst* AI = dyn_cast(QI)) { From djg at cray.com Tue Jul 10 13:20:44 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 10 Jul 2007 18:20:44 -0000 Subject: [llvm-commits] [llvm] r38503 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/peep-vector-extract-concat.ll test/CodeGen/X86/peep-vector-extract-insert.ll Message-ID: <200707101820.l6AIKvWl009439@zion.cs.uiuc.edu> Author: djg Date: Tue Jul 10 13:20:44 2007 New Revision: 38503 URL: http://llvm.org/viewvc/llvm-project?rev=38503&view=rev Log: Change the peep for EXTRACT_VECTOR_ELT of BUILD_PAIR to look for the new CONCAT_VECTORS node type instead, as that's what legalize uses now. And add a peep for EXTRACT_VECTOR_ELT of INSERT_VECTOR_ELT. Added: llvm/trunk/test/CodeGen/X86/peep-vector-extract-concat.ll llvm/trunk/test/CodeGen/X86/peep-vector-extract-insert.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=38503&r1=38502&r2=38503&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jul 10 13:20:44 2007 @@ -1968,19 +1968,31 @@ case ISD::EXTRACT_VECTOR_ELT: assert(N2C && "Bad EXTRACT_VECTOR_ELT!"); - // EXTRACT_VECTOR_ELT of BUILD_PAIR is often formed while lowering is + // EXTRACT_VECTOR_ELT of CONCAT_VECTORS is often formed while lowering is // expanding copies of large vectors from registers. - if (N1.getOpcode() == ISD::BUILD_PAIR) { - unsigned NewNumElts = MVT::getVectorNumElements(N1.getValueType()) / 2; - bool Low = N2C->getValue() < NewNumElts; - return getNode(ISD::EXTRACT_VECTOR_ELT, VT, N1.getOperand(!Low), - Low ? N2 : getConstant(N2C->getValue() - NewNumElts, - N2.getValueType())); + 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(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!"); Added: llvm/trunk/test/CodeGen/X86/peep-vector-extract-concat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/peep-vector-extract-concat.ll?rev=38503&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/peep-vector-extract-concat.ll (added) +++ llvm/trunk/test/CodeGen/X86/peep-vector-extract-concat.ll Tue Jul 10 13:20:44 2007 @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep {shufps \$3, %xmm0, %xmm0} + +define float @foo(<8 x float> %a) { + %c = extractelement <8 x float> %a, i32 3 + ret float %c +} Added: llvm/trunk/test/CodeGen/X86/peep-vector-extract-insert.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/peep-vector-extract-insert.ll?rev=38503&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/peep-vector-extract-insert.ll (added) +++ llvm/trunk/test/CodeGen/X86/peep-vector-extract-insert.ll Tue Jul 10 13:20:44 2007 @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep {pxor %xmm0, %xmm0} | wc -l | grep 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 %a, i32 3 + %c = extractelement <4 x float> %b, i32 2 + ret float %c +} From resistor at mac.com Tue Jul 10 13:43:15 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 18:43:15 -0000 Subject: [llvm-commits] [llvm] r38504 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200707101843.l6AIhHJS010288@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 13:43:15 2007 New Revision: 38504 URL: http://llvm.org/viewvc/llvm-project?rev=38504&view=rev Log: Handle vaarg instructions correctly. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=38504&r1=38503&r2=38504&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 10 13:43:15 2007 @@ -67,6 +67,9 @@ pointerSize = C->getZExtValue(); else pointerSize = ~0UL; + } else if (VAArgInst* V = dyn_cast(QI)) { + pointer = V->getOperand(0); + pointerSize = TD.getTypeSize(V->getType()); } else if (FreeInst* F = dyn_cast(QI)) { pointer = F->getPointerOperand(); @@ -130,6 +133,9 @@ dependee = L->getPointerOperand(); dependeeSize = TD.getTypeSize(L->getType()); queryIsVolatile = L->isVolatile(); + } else if (VAArgInst* V = dyn_cast(QI)) { + dependee = V->getOperand(0); + dependeeSize = TD.getTypeSize(V->getType()); } else if (FreeInst* F = dyn_cast(QI)) { dependee = F->getPointerOperand(); @@ -176,6 +182,9 @@ pointerSize = C->getZExtValue(); else pointerSize = ~0UL; + } else if (VAArgInst* V = dyn_cast(QI)) { + pointer = V->getOperand(0); + pointerSize = TD.getTypeSize(V->getType()); } else if (FreeInst* F = dyn_cast(QI)) { pointer = F->getPointerOperand(); From asl at math.spbu.ru Tue Jul 10 14:07:35 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 10 Jul 2007 19:07:35 -0000 Subject: [llvm-commits] [llvm] r38505 - /llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Message-ID: <200707101907.l6AJ7lqh011001@zion.cs.uiuc.edu> Author: asl Date: Tue Jul 10 14:07:35 2007 New Revision: 38505 URL: http://llvm.org/viewvc/llvm-project?rev=38505&view=rev Log: During module cloning copy aliases too. This fixes PR1544 Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=38505&r1=38504&r2=38505&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Tue Jul 10 14:07:35 2007 @@ -69,6 +69,12 @@ 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. @@ -103,6 +109,15 @@ 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(ValueMap[I]); + GA->setLinkage(I->getLinkage()); + if (const Constant* C = I->getAliasee()) + GA->setAliasee(cast(MapValue(C, ValueMap))); + } + return New; } From rafael.espindola at gmail.com Tue Jul 10 14:28:12 2007 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Tue, 10 Jul 2007 19:28:12 -0000 Subject: [llvm-commits] [llvm] r38506 - in /llvm/trunk: lib/VMCore/Verifier.cpp test/Verifier/byval-1.ll test/Verifier/byval-2.ll test/Verifier/byval-3.ll test/Verifier/byval-4.ll Message-ID: <200707101928.l6AJSRK8012105@zion.cs.uiuc.edu> Author: rafael Date: Tue Jul 10 14:28:12 2007 New Revision: 38506 URL: http://llvm.org/viewvc/llvm-project?rev=38506&view=rev Log: check for correct usage of the byval attribute Added: llvm/trunk/test/Verifier/byval-1.ll llvm/trunk/test/Verifier/byval-2.ll llvm/trunk/test/Verifier/byval-3.ll llvm/trunk/test/Verifier/byval-4.ll Modified: llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=38506&r1=38505&r2=38506&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Jul 10 14:28:12 2007 @@ -361,6 +361,10 @@ if (const ParamAttrsList *Attrs = FT->getParamAttrs()) { unsigned Idx = 1; + + Assert(!Attrs->paramHasAttr(0, ParamAttr::ByVal), + "Attribute ByVal should not apply to functions!"); + for (FunctionType::param_iterator I = FT->param_begin(), E = FT->param_end(); I != E; ++I, ++Idx) { if (Attrs->paramHasAttr(Idx, ParamAttr::ZExt) || @@ -370,9 +374,14 @@ if (Attrs->paramHasAttr(Idx, ParamAttr::NoAlias)) Assert1(isa(FT->getParamType(Idx-1)), "Attribute NoAlias should only apply to Pointer type!", &F); - if (Attrs->paramHasAttr(Idx, ParamAttr::ByVal)) + if (Attrs->paramHasAttr(Idx, ParamAttr::ByVal)) { Assert1(isa(FT->getParamType(Idx-1)), - "Attribute ByVal should only apply to Pointer type!", &F); + "Attribute ByVal should only apply to pointer to structs!", &F); + const PointerType *Ty = + cast(FT->getParamType(Idx-1)); + Assert1(isa(Ty->getElementType()), + "Attribute ByVal should only apply to pointer to structs!", &F); + } } } Added: llvm/trunk/test/Verifier/byval-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/byval-1.ll?rev=38506&view=auto ============================================================================== --- llvm/trunk/test/Verifier/byval-1.ll (added) +++ llvm/trunk/test/Verifier/byval-1.ll Tue Jul 10 14:28:12 2007 @@ -0,0 +1,2 @@ +; RUN: not llvm-as < %s -o /dev/null -f +declare void @h(i32* byval %num) Added: llvm/trunk/test/Verifier/byval-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/byval-2.ll?rev=38506&view=auto ============================================================================== --- llvm/trunk/test/Verifier/byval-2.ll (added) +++ llvm/trunk/test/Verifier/byval-2.ll Tue Jul 10 14:28:12 2007 @@ -0,0 +1,2 @@ +; RUN: not llvm-as < %s -o /dev/null -f +declare void @h(i32* %num) byval Added: llvm/trunk/test/Verifier/byval-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/byval-3.ll?rev=38506&view=auto ============================================================================== --- llvm/trunk/test/Verifier/byval-3.ll (added) +++ llvm/trunk/test/Verifier/byval-3.ll Tue Jul 10 14:28:12 2007 @@ -0,0 +1,2 @@ +; RUN: not llvm-as < %s -o /dev/null -f +declare void @h(i32 byval %num) Added: llvm/trunk/test/Verifier/byval-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/byval-4.ll?rev=38506&view=auto ============================================================================== --- llvm/trunk/test/Verifier/byval-4.ll (added) +++ llvm/trunk/test/Verifier/byval-4.ll Tue Jul 10 14:28:12 2007 @@ -0,0 +1,4 @@ +; RUN: llvm-as < %s -o /dev/null -f +%struct.foo = type { i64 } + +declare void @h(%struct.foo* byval %num) From sabre at nondot.org Tue Jul 10 15:03:50 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Jul 2007 20:03:50 -0000 Subject: [llvm-commits] [llvm] r38507 - /llvm/trunk/lib/Target/X86/README-SSE.txt Message-ID: <200707102003.l6AK3oVO013423@zion.cs.uiuc.edu> Author: lattner Date: Tue Jul 10 15:03:50 2007 New Revision: 38507 URL: http://llvm.org/viewvc/llvm-project?rev=38507&view=rev Log: add a note Modified: llvm/trunk/lib/Target/X86/README-SSE.txt Modified: llvm/trunk/lib/Target/X86/README-SSE.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=38507&r1=38506&r2=38507&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) +++ llvm/trunk/lib/Target/X86/README-SSE.txt Tue Jul 10 15:03:50 2007 @@ -572,3 +572,29 @@ ret //===---------------------------------------------------------------------===// + +This code: + +#include +__m128i test(long long i) { return _mm_cvtsi64x_si128(i); } + +Should turn into a single 'movq %rdi, %xmm0' instruction. Instead, we +get this (on x86-64): + +_test: + movd %rdi, %xmm1 + xorps %xmm0, %xmm0 + movsd %xmm1, %xmm0 + ret + +The LLVM IR is: + +target triple = "x86_64-apple-darwin8" +define <2 x i64> @test(i64 %i) { +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 +} + +//===---------------------------------------------------------------------===// From resistor at mac.com Tue Jul 10 15:20:19 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 20:20:19 -0000 Subject: [llvm-commits] [llvm] r38508 - /llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Message-ID: <200707102020.l6AKKJFN014076@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 15:20:19 2007 New Revision: 38508 URL: http://llvm.org/viewvc/llvm-project?rev=38508&view=rev Log: Make the pass registration static. Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=38508&r1=38507&r2=38508&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Jul 10 15:20:19 2007 @@ -680,8 +680,8 @@ // createGVNPREPass - The public interface to this file... FunctionPass *llvm::createGVNPREPass() { return new GVNPRE(); } -RegisterPass X("gvnpre", - "Global Value Numbering/Partial Redundancy Elimination"); +static RegisterPass X("gvnpre", + "Global Value Numbering/Partial Redundancy Elimination"); STATISTIC(NumInsertedVals, "Number of values inserted"); From resistor at mac.com Tue Jul 10 15:21:08 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 20:21:08 -0000 Subject: [llvm-commits] [llvm] r38509 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200707102021.l6AKL8pI014109@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 15:21:08 2007 New Revision: 38509 URL: http://llvm.org/viewvc/llvm-project?rev=38509&view=rev Log: Make this pass registration static as well. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=38509&r1=38508&r2=38509&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 10 15:21:08 2007 @@ -29,8 +29,8 @@ Instruction* MemoryDependenceAnalysis::None = (Instruction*)~0; // Register this pass... -RegisterPass X("memdep", - "Memory Dependence Analysis"); +static RegisterPass X("memdep", + "Memory Dependence Analysis"); /// getAnalysisUsage - Does not modify anything. It uses Alias Analysis. /// From resistor at mac.com Tue Jul 10 15:39:08 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 20:39:08 -0000 Subject: [llvm-commits] [llvm] r38510 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200707102039.l6AKd80m014978@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 15:39:07 2007 New Revision: 38510 URL: http://llvm.org/viewvc/llvm-project?rev=38510&view=rev Log: Fix a crasher when finding the dependency of a call. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=38510&r1=38509&r2=38510&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 10 15:39:07 2007 @@ -83,7 +83,8 @@ } else { continue; } - } + } else + continue; if (AA.getModRefInfo(C, pointer, pointerSize) != AliasAnalysis::NoModRef) { depGraphLocal.insert(std::make_pair(C.getInstruction(), std::make_pair(QI, true))); From resistor at mac.com Tue Jul 10 15:48:38 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 10 Jul 2007 20:48:38 -0000 Subject: [llvm-commits] [llvm] r38511 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200707102048.l6AKmcUH015493@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 15:48:38 2007 New Revision: 38511 URL: http://llvm.org/viewvc/llvm-project?rev=38511&view=rev Log: Calculate the size of a array allocation correctly. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=38511&r1=38510&r2=38511&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 10 15:48:38 2007 @@ -64,7 +64,7 @@ } else if (AllocationInst* AI = dyn_cast(QI)) { pointer = AI; if (ConstantInt* C = dyn_cast(AI->getArraySize())) - pointerSize = C->getZExtValue(); + pointerSize = C->getZExtValue() * TD.getTypeSize(AI->getAllocatedType()); else pointerSize = ~0UL; } else if (VAArgInst* V = dyn_cast(QI)) { @@ -180,7 +180,7 @@ } else if (AllocationInst* AI = dyn_cast(QI)) { pointer = AI; if (ConstantInt* C = dyn_cast(AI->getArraySize())) - pointerSize = C->getZExtValue(); + pointerSize = C->getZExtValue() * TD.getTypeSize(AI->getAllocatedType()); else pointerSize = ~0UL; } else if (VAArgInst* V = dyn_cast(QI)) { From dalej at apple.com Tue Jul 10 15:53:41 2007 From: dalej at apple.com (Dale Johannesen) Date: Tue, 10 Jul 2007 20:53:41 -0000 Subject: [llvm-commits] [llvm] r38512 - /llvm/trunk/lib/Target/X86/X86InstrFPStack.td Message-ID: <200707102053.l6AKrfvn015751@zion.cs.uiuc.edu> Author: johannes Date: Tue Jul 10 15:53:41 2007 New Revision: 38512 URL: http://llvm.org/viewvc/llvm-project?rev=38512&view=rev Log: fix 80 columnn violations, increasing the world's pedantic satisfaction level. Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=38512&r1=38511&r2=38512&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Tue Jul 10 15:53:41 2007 @@ -20,9 +20,11 @@ def SDTX86FpGet : SDTypeProfile<1, 0, [SDTCisFP<0>]>; def SDTX86FpSet : SDTypeProfile<0, 1, [SDTCisFP<0>]>; def SDTX86Fld : SDTypeProfile<1, 2, [SDTCisFP<0>, - SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>]>; + SDTCisPtrTy<1>, + SDTCisVT<2, OtherVT>]>; def SDTX86Fst : SDTypeProfile<0, 3, [SDTCisFP<0>, - SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>]>; + 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>]>; @@ -129,27 +131,27 @@ // Random Pseudo Instructions. def FpGETRESULT32 : FpI_<(ops RFP32:$dst), SpecialFP, - [(set RFP32:$dst, X86fpget)]>; // FPR = ST(0) + [(set RFP32:$dst, X86fpget)]>; // FPR = ST(0) def FpGETRESULT64 : FpI_<(ops RFP64:$dst), SpecialFP, - [(set RFP64:$dst, X86fpget)]>; // FPR = ST(0) + [(set RFP64:$dst, X86fpget)]>; // FPR = ST(0) let noResults = 1 in { def FpSETRESULT32 : FpI_<(ops RFP32:$src), SpecialFP, - [(X86fpset RFP32:$src)]>, Imp<[], [ST0]>; // ST(0) = FPR + [(X86fpset RFP32:$src)]>, Imp<[], [ST0]>;// ST(0) = FPR def FpSETRESULT64 : FpI_<(ops RFP64:$src), SpecialFP, - [(X86fpset RFP64:$src)]>, Imp<[], [ST0]>; // ST(0) = FPR + [(X86fpset RFP64:$src)]>, Imp<[], [ST0]>;// ST(0) = FPR } // FpI - Floating Point Psuedo Instruction template. Predicated on FPStack. class FpI pattern> : FpI_, Requires<[FPStack]>; // Register copies. Just copies, the 64->32 version does not truncate. -def MOV_Fp3232 : FpI<(ops RFP32:$dst, RFP32:$src), SpecialFP, []>; // f1 = fmov f2 -def MOV_Fp3264 : FpI<(ops RFP64:$dst, RFP32:$src), SpecialFP, []>; // f1 = fmov f2 -def MOV_Fp6432 : FpI<(ops RFP32:$dst, RFP64:$src), SpecialFP, []>; // f1 = fmov f2 -def MOV_Fp6464 : FpI<(ops RFP64:$dst, RFP64:$src), SpecialFP, []>; // f1 = fmov f2 +def MOV_Fp3232 : FpI<(ops RFP32:$dst, RFP32:$src), SpecialFP, []>; +def MOV_Fp3264 : FpI<(ops RFP64:$dst, RFP32:$src), SpecialFP, []>; +def MOV_Fp6432 : FpI<(ops RFP32:$dst, RFP64:$src), SpecialFP, []>; +def MOV_Fp6464 : FpI<(ops RFP64:$dst, RFP64:$src), SpecialFP, []>; // Factoring for arithmetic. multiclass FPBinary_rr { @@ -165,11 +167,15 @@ multiclass FPBinary { // ST(0) = ST(0) + [mem] def _Fp32m : FpI<(ops RFP32:$dst, RFP32:$src1, f32mem:$src2), OneArgFPRW, - [(set RFP32:$dst, (OpNode RFP32:$src1, (loadf32 addr:$src2)))]>; + [(set RFP32:$dst, + (OpNode RFP32:$src1, (loadf32 addr:$src2)))]>; def _Fp64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW, - [(set RFP64:$dst, (OpNode RFP64:$src1, (loadf64 addr:$src2)))]>; -def _F32m : FPI<0xD8, fp, (ops f32mem:$src), !strconcat("f", !strconcat(asmstring, "{s} $src"))>; -def _F64m : FPI<0xDC, fp, (ops f64mem:$src), !strconcat("f", !strconcat(asmstring, "{l} $src"))>; + [(set RFP64:$dst, + (OpNode RFP64:$src1, (loadf64 addr:$src2)))]>; +def _F32m : FPI<0xD8, fp, (ops f32mem:$src), + !strconcat("f", !strconcat(asmstring, "{s} $src"))>; +def _F64m : FPI<0xDC, fp, (ops f64mem:$src), + !strconcat("f", !strconcat(asmstring, "{l} $src"))>; // ST(0) = ST(0) + [memint] def _FpI16m32 : FpI<(ops RFP32:$dst, RFP32:$src1, i16mem:$src2), OneArgFPRW, [(set RFP32:$dst, (OpNode RFP32:$src1, @@ -183,8 +189,10 @@ def _FpI32m64 : FpI<(ops RFP64:$dst, RFP64:$src1, i32mem:$src2), OneArgFPRW, [(set RFP64:$dst, (OpNode RFP64:$src1, (X86fild addr:$src2, i32)))]>; -def _FI16m : FPI<0xDE, fp, (ops i16mem:$src), !strconcat("fi", !strconcat(asmstring, "{s} $src"))>; -def _FI32m : FPI<0xDA, fp, (ops i32mem:$src), !strconcat("fi", !strconcat(asmstring, "{l} $src"))>; +def _FI16m : FPI<0xDE, fp, (ops i16mem:$src), + !strconcat("fi", !strconcat(asmstring, "{s} $src"))>; +def _FI32m : FPI<0xDA, fp, (ops i32mem:$src), + !strconcat("fi", !strconcat(asmstring, "{l} $src"))>; } defm ADD : FPBinary_rr; @@ -386,11 +394,11 @@ def UCOM_Fpr32 : FpI<(ops RFP32:$lhs, RFP32:$rhs), CompareFP, []>; // FPSW = cmp ST(0) with ST(i) def UCOM_FpIr32: FpI<(ops RFP32:$lhs, RFP32:$rhs), CompareFP, - [(X86cmp RFP32:$lhs, RFP32:$rhs)]>; // CC = cmp ST(0) with ST(i) + [(X86cmp RFP32:$lhs, RFP32:$rhs)]>; // CC = ST(0) cmp ST(i) def UCOM_Fpr64 : FpI<(ops RFP64:$lhs, RFP64:$rhs), CompareFP, []>; // FPSW = cmp ST(0) with ST(i) def UCOM_FpIr64: FpI<(ops RFP64:$lhs, RFP64:$rhs), CompareFP, - [(X86cmp RFP64:$lhs, RFP64:$rhs)]>; // CC = cmp ST(0) with ST(i) + [(X86cmp RFP64:$lhs, RFP64:$rhs)]>; // CC = ST(0) cmp ST(i) def UCOM_Fr : FPI<0xE0, AddRegFrm, // FPSW = cmp ST(0) with ST(i) (ops RST:$reg), @@ -440,5 +448,6 @@ // Used to conv. i64 to f64 since there isn't a SSE version. def : Pat<(X86fildflag addr:$src, i64), (ILD_Fp64m64 addr:$src)>; -def : Pat<(extloadf32 addr:$src), (MOV_Fp3264 (LD_Fp32m addr:$src))>, Requires<[FPStack]>; +def : Pat<(extloadf32 addr:$src), + (MOV_Fp3264 (LD_Fp32m addr:$src))>, Requires<[FPStack]>; def : Pat<(fextend RFP32:$src), (MOV_Fp3264 RFP32:$src)>, Requires<[FPStack]>; From evan.cheng at apple.com Tue Jul 10 16:49:47 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 21:49:47 -0000 Subject: [llvm-commits] [llvm] r38513 - in /llvm/trunk/lib/Target/ARM: ARMConstantIslandPass.cpp README.txt Message-ID: <200707102149.l6ALnlRO017832@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 16:49:47 2007 New Revision: 38513 URL: http://llvm.org/viewvc/llvm-project?rev=38513&view=rev Log: Update. Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp llvm/trunk/lib/Target/ARM/README.txt Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=38513&r1=38512&r2=38513&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Tue Jul 10 16:49:47 2007 @@ -199,8 +199,8 @@ /// 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"; + DOUT << "block " << J << " offset " << BBOffsets[J] << + " size " << BBSizes[J] << "\n"; } } @@ -255,10 +255,10 @@ bool Change = false; for (unsigned i = 0, e = CPUsers.size(); i != e; ++i) Change |= HandleConstantPoolUser(Fn, i); - DEBUG(dumpBBs()); + //DEBUG(dumpBBs()); for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i) Change |= FixUpImmediateBr(Fn, ImmBranches[i]); - DEBUG(dumpBBs()); + //DEBUG(dumpBBs()); if (!Change) break; MadeChange = true; @@ -798,8 +798,8 @@ 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"; + if (CPEIsInRange(UserMI, UserOffset, CPEMI, U.MaxDisp, false /*true*/)) { + //DOUT << "In range\n"; return 1; } @@ -1120,11 +1120,13 @@ unsigned BrOffset = GetOffsetOf(MI) + PCAdj; unsigned DestOffset = BBOffsets[DestBB->getNumber()]; +#if 0 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; +#endif if (BrOffset <= DestOffset) { // Branch before the Dest. Modified: llvm/trunk/lib/Target/ARM/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/README.txt?rev=38513&r1=38512&r2=38513&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/README.txt (original) +++ llvm/trunk/lib/Target/ARM/README.txt Tue Jul 10 16:49:47 2007 @@ -7,7 +7,6 @@ * 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 predication support * Implement pre/post increment support. (e.g. PR935) * Coalesce stack slots! * Implement smarter constant generation for binops with large immediates. @@ -44,16 +43,12 @@ //===---------------------------------------------------------------------===// -We need to start generating predicated instructions. The .td files have a way -to express this now (see the PPC conditional return instruction), but the -branch folding pass (or a new if-cvt pass) should start producing these, at -least in the trivial case. - -Among the obvious wins, doing so can eliminate the need to custom expand -copysign (i.e. we won't need to custom expand it to get the conditional -negate). +Eliminate copysign custom expansion. We are still generating crappy code with +default expansion + if-conversion. -This allows us to eliminate one instruction from: +//===---------------------------------------------------------------------===// + +Eliminate one instruction from: define i32 @_Z6slow4bii(i32 %x, i32 %y) { %tmp = icmp sgt i32 %x, %y @@ -66,6 +61,12 @@ movgt r1, r0 mov r0, r1 bx lr +=> + +__Z6slow4bii: + cmp r0, r1 + movle r0, r1 + bx lr //===---------------------------------------------------------------------===// From dalej at apple.com Tue Jul 10 16:53:30 2007 From: dalej at apple.com (Dale Johannesen) Date: Tue, 10 Jul 2007 21:53:30 -0000 Subject: [llvm-commits] [llvm] r38514 - in /llvm/trunk/lib/Target/X86: X86FloatingPoint.cpp X86InstrFPStack.td Message-ID: <200707102153.l6ALrVV6018026@zion.cs.uiuc.edu> Author: johannes Date: Tue Jul 10 16:53:30 2007 New Revision: 38514 URL: http://llvm.org/viewvc/llvm-project?rev=38514&view=rev Log: Fix fp_constant_op failure. Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Target/X86/X86InstrFPStack.td Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=38514&r1=38513&r2=38514&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Tue Jul 10 16:53:30 2007 @@ -326,8 +326,9 @@ static const TableEntry OpcodeTable[] = { { X86::ABS_Fp32 , X86::ABS_F }, { X86::ABS_Fp64 , X86::ABS_F }, - { X86::ADD_Fp32m , X86::ADD_F32m }, - { X86::ADD_Fp64m , X86::ADD_F64m }, + { X86::ADD_Fp32m , X86::ADD_F32m }, + { X86::ADD_Fp64m , X86::ADD_F64m }, + { X86::ADD_Fp64m32 , X86::ADD_F32m }, { X86::ADD_FpI16m32 , X86::ADD_FI16m }, { X86::ADD_FpI16m64 , X86::ADD_FI16m }, { X86::ADD_FpI32m32 , X86::ADD_FI32m }, @@ -354,12 +355,14 @@ { X86::COS_Fp64 , X86::COS_F }, { X86::DIVR_Fp32m , X86::DIVR_F32m }, { X86::DIVR_Fp64m , X86::DIVR_F64m }, + { X86::DIVR_Fp64m32 , X86::DIVR_F32m }, { X86::DIVR_FpI16m32, X86::DIVR_FI16m}, { X86::DIVR_FpI16m64, X86::DIVR_FI16m}, { X86::DIVR_FpI32m32, X86::DIVR_FI32m}, { X86::DIVR_FpI32m64, X86::DIVR_FI32m}, { X86::DIV_Fp32m , X86::DIV_F32m }, { X86::DIV_Fp64m , X86::DIV_F64m }, + { X86::DIV_Fp64m32 , X86::DIV_F32m }, { X86::DIV_FpI16m32 , X86::DIV_FI16m }, { X86::DIV_FpI16m64 , X86::DIV_FI16m }, { X86::DIV_FpI32m32 , X86::DIV_FI32m }, @@ -390,6 +393,7 @@ { X86::LD_Fp64m , X86::LD_F64m }, { X86::MUL_Fp32m , X86::MUL_F32m }, { X86::MUL_Fp64m , X86::MUL_F64m }, + { X86::MUL_Fp64m32 , X86::MUL_F32m }, { X86::MUL_FpI16m32 , X86::MUL_FI16m }, { X86::MUL_FpI16m64 , X86::MUL_FI16m }, { X86::MUL_FpI32m32 , X86::MUL_FI32m }, @@ -403,12 +407,14 @@ { X86::ST_Fp64m32 , X86::ST_F32m }, { X86::SUBR_Fp32m , X86::SUBR_F32m }, { X86::SUBR_Fp64m , X86::SUBR_F64m }, + { X86::SUBR_Fp64m32 , X86::SUBR_F32m }, { X86::SUBR_FpI16m32, X86::SUBR_FI16m}, { X86::SUBR_FpI16m64, X86::SUBR_FI16m}, { X86::SUBR_FpI32m32, X86::SUBR_FI32m}, { X86::SUBR_FpI32m64, X86::SUBR_FI32m}, { X86::SUB_Fp32m , X86::SUB_F32m }, { X86::SUB_Fp64m , X86::SUB_F64m }, + { X86::SUB_Fp64m32 , X86::SUB_F32m }, { X86::SUB_FpI16m32 , X86::SUB_FI16m }, { X86::SUB_FpI16m64 , X86::SUB_FI16m }, { X86::SUB_FpI32m32 , X86::SUB_FI32m }, Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=38514&r1=38513&r2=38514&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Tue Jul 10 16:53:30 2007 @@ -172,6 +172,9 @@ def _Fp64m : FpI<(ops RFP64:$dst, RFP64:$src1, f64mem:$src2), OneArgFPRW, [(set RFP64:$dst, (OpNode RFP64:$src1, (loadf64 addr:$src2)))]>; +def _Fp64m32: FpI<(ops RFP64:$dst, RFP64:$src1, f32mem:$src2), OneArgFPRW, + [(set RFP64:$dst, + (OpNode RFP64:$src1, (extloadf32 addr:$src2)))]>; def _F32m : FPI<0xD8, fp, (ops f32mem:$src), !strconcat("f", !strconcat(asmstring, "{s} $src"))>; def _F64m : FPI<0xDC, fp, (ops f64mem:$src), From evan.cheng at apple.com Tue Jul 10 17:00:17 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Jul 2007 22:00:17 -0000 Subject: [llvm-commits] [llvm] r38515 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200707102200.l6AM0HqB018268@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 10 17:00:16 2007 New Revision: 38515 URL: http://llvm.org/viewvc/llvm-project?rev=38515&view=rev Log: Didn't mean the last commit. Revert. Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=38515&r1=38514&r2=38515&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Tue Jul 10 17:00:16 2007 @@ -199,8 +199,8 @@ /// 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"; + DOUT << "block" << J << " offset" << BBOffsets[J] << + " size" << BBSizes[J] << "\n"; } } @@ -255,10 +255,10 @@ bool Change = false; for (unsigned i = 0, e = CPUsers.size(); i != e; ++i) Change |= HandleConstantPoolUser(Fn, i); - //DEBUG(dumpBBs()); + DEBUG(dumpBBs()); for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i) Change |= FixUpImmediateBr(Fn, ImmBranches[i]); - //DEBUG(dumpBBs()); + DEBUG(dumpBBs()); if (!Change) break; MadeChange = true; @@ -798,8 +798,8 @@ MachineInstr *CPEMI = U.CPEMI; // Check to see if the CPE is already in-range. - if (CPEIsInRange(UserMI, UserOffset, CPEMI, U.MaxDisp, false /*true*/)) { - //DOUT << "In range\n"; + if (CPEIsInRange(UserMI, UserOffset, CPEMI, U.MaxDisp, true)) { + DOUT << "In range\n"; return 1; } @@ -1120,13 +1120,11 @@ unsigned BrOffset = GetOffsetOf(MI) + PCAdj; unsigned DestOffset = BBOffsets[DestBB->getNumber()]; -#if 0 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; -#endif if (BrOffset <= DestOffset) { // Branch before the Dest. From greened at obbligato.org Tue Jul 10 17:00:30 2007 From: greened at obbligato.org (David Greene) Date: Tue, 10 Jul 2007 22:00:30 -0000 Subject: [llvm-commits] [llvm] r38516 - /llvm/trunk/lib/CodeGen/BranchFolding.cpp Message-ID: <200707102200.l6AM0UIm018289@zion.cs.uiuc.edu> Author: greened Date: Tue Jul 10 17:00:30 2007 New Revision: 38516 URL: http://llvm.org/viewvc/llvm-project?rev=38516&view=rev Log: Make this work with GLIBCXX_DEBUG. Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=38516&r1=38515&r2=38516&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Tue Jul 10 17:00:30 2007 @@ -429,8 +429,15 @@ return true; else if (p.second->getNumber() > q.second->getNumber()) return false; - else + else { + // _GLIBCXX_DEBUG needs to check strict weak ordering and it + // does it by doing a compare on the same object. +#ifdef _GLIBCXX_DEBUG + return(false); +#else assert(0 && "Predecessor appears twice"); +#endif + } } // See if any of the blocks in MergePotentials (which all have a common single From resistor at mac.com Tue Jul 10 19:46:18 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 11 Jul 2007 00:46:18 -0000 Subject: [llvm-commits] [llvm] r38517 - in /llvm/trunk: include/llvm/LinkAllPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707110046.l6B0kIWe023024@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 10 19:46:18 2007 New Revision: 38517 URL: http://llvm.org/viewvc/llvm-project?rev=38517&view=rev Log: Add FastDSE, a new algorithm for doing dead store elimination. This algorithm is not as accurate as the current DSE, but it only a linear scan over each block, rather than quadratic. Eventually (once it has been improved somewhat), this will replace the current DSE. NOTE: This has not yet been extensively tested. Added: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/include/llvm/LinkAllPasses.h llvm/trunk/include/llvm/Transforms/Scalar.h Modified: llvm/trunk/include/llvm/LinkAllPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=38517&r1=38516&r2=38517&view=diff ============================================================================== --- llvm/trunk/include/llvm/LinkAllPasses.h (original) +++ llvm/trunk/include/llvm/LinkAllPasses.h Tue Jul 10 19:46:18 2007 @@ -61,6 +61,7 @@ (void) llvm::createDeadStoreEliminationPass(); (void) llvm::createDeadTypeEliminationPass(); (void) llvm::createEdgeProfilerPass(); + (void) llvm::createFastDeadStoreEliminationPass(); (void) llvm::createFunctionInliningPass(); (void) llvm::createFunctionProfilerPass(); (void) llvm::createGCSEPass(); Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=38517&r1=38516&r2=38517&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Tue Jul 10 19:46:18 2007 @@ -325,6 +325,13 @@ //===----------------------------------------------------------------------===// // +// FastDeadStoreElimination - This pass deletes stores that are post-dominated by +// must-aliased stores and are not loaded used between the stores. +// +FunctionPass *createFastDeadStoreEliminationPass(); + +//===----------------------------------------------------------------------===// +// // CodeGenPrepare - This pass prepares a function for instruction selection. // FunctionPass *createCodeGenPreparePass(const TargetLowering *TLI = 0); Added: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=38517&view=auto ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (added) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Tue Jul 10 19:46:18 2007 @@ -0,0 +1,130 @@ +//===- DeadStoreElimination.cpp - Dead Store Elimination ------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by the LLVM research group and 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 "fdse" +#include "llvm/Transforms/Scalar.h" +#include "llvm/Function.h" +#include "llvm/Instructions.h" +#include "llvm/Pass.h" +#include "llvm/ADT/SetVector.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/Analysis/MemoryDependenceAnalysis.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 FDSE : public FunctionPass { + static char ID; // Pass identification, replacement for typeid + FDSE() : 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); + void DeleteDeadInstructionChains(Instruction *I, + SetVector &DeadInsts); + + // getAnalysisUsage - We require post dominance frontiers (aka Control + // Dependence Graph) + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesCFG(); + AU.addRequired(); + AU.addPreserved(); + } + }; + char FDSE::ID = 0; + RegisterPass X("fdse", "Fast Dead Store Elimination"); +} + +FunctionPass *llvm::createFastDeadStoreEliminationPass() { return new FDSE(); } + +bool FDSE::runOnBasicBlock(BasicBlock &BB) { + MemoryDependenceAnalysis& MD = getAnalysis(); + + DenseMap lastStore; + SetVector 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... + if (StoreInst* S = dyn_cast(BBI)) { + + // ... to a pointer that has been stored to before... + if (lastStore.count(S->getPointerOperand())) { + StoreInst* last = lastStore[S->getPointerOperand()]; + + // ... and no other memory dependencies are between them.... + if (MD.getDependency(S) == last) { + // Remove it! + MD.removeInstruction(last); + + // DCE instructions only used to calculate that store + if (Instruction* D = dyn_cast(last->getOperand(0))) + possiblyDead.insert(D); + + last->eraseFromParent(); + NumFastStores++; + MadeChange = true; + } + } + + // Update our most-recent-store map + lastStore.insert(std::make_pair(S->getPointerOperand(), S)); + } + } + + // Do a trivial DCE + while (!possiblyDead.empty()) { + Instruction *I = possiblyDead.back(); + possiblyDead.pop_back(); + DeleteDeadInstructionChains(I, possiblyDead); + } + + return MadeChange; +} + +void FDSE::DeleteDeadInstructionChains(Instruction *I, + SetVector &DeadInsts) { + // Instruction must be dead. + if (!I->use_empty() || !isInstructionTriviallyDead(I)) return; + + // Let the memory dependence know + getAnalysis().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 (Instruction *Op = dyn_cast(I->getOperand(i))) + DeadInsts.insert(Op); // Attempt to nuke it later. + I->setOperand(i, 0); // Drop from the operand list. + } + + I->eraseFromParent(); + ++NumFastOther; +} From reid at x10sys.com Tue Jul 10 20:03:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 01:03:00 -0000 Subject: [llvm-commits] [llvm-top] r38518 - in /llvm-top/trunk: get library.sh Message-ID: <200707110103.l6B130s6023449@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 20:03:00 2007 New Revision: 38518 URL: http://llvm.org/viewvc/llvm-project?rev=38518&view=rev Log: First shot at Bourne shell based tools for managing checkout, configure, build. The library.sh script contains enough to extract module dependencies in the right order while the get script simply calls library.sh to checkout one or more modules and their dependencies. To follow: configure, build, and maybe other scripts. Added: llvm-top/trunk/get (with props) llvm-top/trunk/library.sh Added: llvm-top/trunk/get URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/get?rev=38518&view=auto ============================================================================== --- llvm-top/trunk/get (added) +++ llvm-top/trunk/get Tue Jul 10 20:03:00 2007 @@ -0,0 +1,18 @@ +#!/bin/sh +# get script +# +# This file was developed by Reid Spencer and is distributed under the +# University of Illinois Open Source License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# + +# This script allows easier checkout of LLVM modules. Just specify the names +# of the modules on the command line. +. ./library.sh + +# Getting the module dependencies also causes them to be checked out. +MODULE_DEPENDENCIES="" +get_dependencies "$@" + +# Report what happened. +echo Modules checked out:"$MODULE_DEPENDENCIES". Propchange: llvm-top/trunk/get ------------------------------------------------------------------------------ svn:executable = * Added: llvm-top/trunk/library.sh URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/library.sh?rev=38518&view=auto ============================================================================== --- llvm-top/trunk/library.sh (added) +++ llvm-top/trunk/library.sh Tue Jul 10 20:03:00 2007 @@ -0,0 +1,91 @@ +# llvm-top common script +# +# This file was developed by Reid Spencer and is distributed under the +# University of Illinois Open Source License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# + +# This script provides the script fragments and functions that are common to +# the scripts in the llvm-top module. + +# The arguments to all scripts are +# Define where subversion is. We assume by default its in the path. +SVN=svn + +# A command to figure out the root of the SVN repository by asking for it from +# the 'svn info' command. To use, execute it in a script with something like +SVNROOT=`$SVN info . | grep 'pository Root:' | sed -e 's/^Repository Root: //'` + +# Set this to true (after sourcing this library) if you want verbose +# output from the library +VERBOSE=0 + +# Rule to get the modules that $(MODULE) depends on. +#MODULEINFO = $(MODULE)/ModuleInfo.txt +#DEPMODULES = grep -i DepModule: $(MODULEINFO) | sed 's/DepModule: *//g' +#BUILDTARGET = grep -i BuildTarget: $(MODULEINFO) | sed 's/BuildTarget: *//g' +#CONFIGTARGET = grep -i ConfigTarget: $(MODULEINFO) | sed 's/ConfigTarget: *//g' + +# Figure out the root of the SVN repository by asking for it from 'svn info' +#SVNROOT = $(shell $(SVN) info . | grep 'Repository Root:' | \ +# sed -e 's/^Repository Root: //') + + +# Check out a module and all its dependencies. Note that this arrangement +# depends on each module having a file named ModuleInfo.txt that explicitly +# indicates the other LLVM modules it depends on. See one of those files for +# examples. + +msg() { + level=$1 + shift + if test "$level" -le "$VERBOSE" ; then + echo "INFO-$level: $*" + fi +} + +die() { + EXIT_CODE=$1 + shift + echo "ERROR-$EXIT_CODE: $*" + exit $EXIT_CODE +} + +checkout() { + module=$1 + msg 1 "Checking out module $module" + $SVN checkout $SVNROOT/$module/trunk $module || \ + die $? "Checkout of module $module failed." + return 0 +} + +get_dependencies() { + for module in $* ; do + if test ! -d "$module" ; then + checkout "$module" || die $? "Checkout failed." + fi + mi="$module/ModuleInfo.txt" + dep_modules="" + if test -f "$mi" ; then + dep_modules=`grep -i DepModule: $mi | sed 's/DepModule: *//g'` + if test "$?" -ne 0 ; then + die $? "Searching file '$mi' failed." + fi + fi + if test ! -z "$dep_modules" ; then + msg 1 "Module '$module' depends on $dep_modules" + deps=`get_dependencies $dep_modules` || die $? "get_dependencies failed" + for dep in $dep_modules ; do + matching=`echo "$MODULE_DEPENDENCIES" | grep "$dep"` + if test -z "$matching" ; then + MODULE_DEPENDENCIES="$MODULE_DEPENDENCIES $dep" + fi + done + fi + matching=`echo "$MODULE_DEPENDENCIES" | grep "$module"` + if test -z "$matching" ; then + MODULE_DEPENDENCIES="$MODULE_DEPENDENCIES $module" + fi + done + return 0 +} From reid at x10sys.com Tue Jul 10 21:58:34 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 02:58:34 -0000 Subject: [llvm-commits] [llvm-top] r38519 - in /llvm-top/trunk: configure library.sh Message-ID: <200707110258.l6B2wYVw026248@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 21:58:34 2007 New Revision: 38519 URL: http://llvm.org/viewvc/llvm-project?rev=38519&view=rev Log: Add support for the configure script. This will checkout and configure the modules specified on the command line as well as any of their dependencies. The configuration commands come from the ModuleInfo.txt file in each module. Added: llvm-top/trunk/configure (with props) Modified: llvm-top/trunk/library.sh Added: llvm-top/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/configure?rev=38519&view=auto ============================================================================== --- llvm-top/trunk/configure (added) +++ llvm-top/trunk/configure Tue Jul 10 21:58:34 2007 @@ -0,0 +1,52 @@ +#!/bin/sh +# configure script +# +# This file was developed by Reid Spencer and is distributed under the +# University of Illinois Open Source License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# +# This script allows LLVM modules to be configured including processing +# dependencies and optional configuration parameters. Use it like this: +# +# cd llvm-top +# ./configure {module_names} {configure_options} +# +# where: +# {module_names} is a list of modules you want to configure (e.g. llvm, hlvm) +# {configure_options} is any options you want to pass to *all* the modules +# when they run their configure commands +# +# Note that the script will checkout and configure any dependent modules as well +# as the ones specified in {module_names} so it is only necessary to specify the +# minimal set you're interested in. + +# Get the library code +. ./library.sh + +# Process the arguments so that anything starting with - is passed down to the +# configure scripts while anything else is a module name. Collect the arguments +# in appropriate variables for later use. +for arg in "$@" ; do + case "$arg" in + -*) + CONFIGURE_ARGS="$CONFIGURE_ARGS $arg" + ;; + *) + MODULE_NAMES="$MODULE_NAMES $arg" + esac +done + +# Get (and possibly check out) the set of modules and their dependencies. This +# sets the MODULE_DEPENDENCIES variable to the set of module names that should +# be configured, in the correct order (least dependent first, no duplicates). +MODULE_DEPENDENCIES="" +get_dependencies $MODULE_NAMES + +# Now that we have a list of dependent modules, we must configure each of them +# according to the specifications of the module. +for mod in $MODULE_DEPENDENCIES ; do + configure_module "$mod" "$CONFIGURE_ARGS" +done + +# Just indicate what modules we configured +echo Modules configured:"$MODULE_DEPENDENCIES". Propchange: llvm-top/trunk/configure ------------------------------------------------------------------------------ svn:executable = * Modified: llvm-top/trunk/library.sh URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/library.sh?rev=38519&r1=38518&r2=38519&view=diff ============================================================================== --- llvm-top/trunk/library.sh (original) +++ llvm-top/trunk/library.sh Tue Jul 10 21:58:34 2007 @@ -67,10 +67,12 @@ mi="$module/ModuleInfo.txt" dep_modules="" if test -f "$mi" ; then - dep_modules=`grep -i DepModule: $mi | sed 's/DepModule: *//g'` + dep_modules=`grep -i DepModule: $mi | sed -e 's/DepModule: *//g'` if test "$?" -ne 0 ; then die $? "Searching file '$mi' failed." fi + else + msg 0 "Module $module has not ModuleInfo.txt file" fi if test ! -z "$dep_modules" ; then msg 1 "Module '$module' depends on $dep_modules" @@ -89,3 +91,38 @@ done return 0 } + +configure_module() { + module="$1" + config_opts="$2" + if test ! -d "$module" ; then + die 1 "Module $module did not get checked out!" + fi + LLVM_TOP=`pwd` + MODULE_INFO="$LLVM_TOP/$module/ModuleInfo.txt" + INSTALL_PREFIX="$LLVM_TOP/install" + if test -f "$MODULE_INFO" ; then + config_command=`grep -i ConfigCmd: $MODULE_INFO | sed -e 's/ConfigCmd: //'` + config_file=`grep -i ConfigFile: $mi | sed -e 's/ConfigFile: //'` + fi + if test -z "$config_command" ; then + msg 0 "Module $module has no ConfigCmd entry so it won't be configured" + return 0 + fi + cd $module + if test -e "$config_file" ; then + msg 0 "Module $module is already configured" + else + config_command=`echo $config_command $config_opts | sed \ + -e "s#@LLVM_TOP@#$LLVM_TOP#g" \ + -e "s#@INSTALL_PREFIX@#$INSTALL_PREFIX#g" \ + -e "s#@CONFIG_OPTS@#$config_opts#g"` + if test "$?" -ne 0 ; then + die $? "Failed to generate configure command" + fi + msg 0 "Configuring Module $module with this command:" + msg 0 " $config_command" + $config_command || die $? "Can't configure $module" + fi + cd $LLVM_TOP +} From reid at x10sys.com Tue Jul 10 21:59:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 02:59:25 -0000 Subject: [llvm-commits] [stacker] r38520 - /stacker/trunk/ModuleInfo.txt Message-ID: <200707110259.l6B2xPkl026281@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 21:59:25 2007 New Revision: 38520 URL: http://llvm.org/viewvc/llvm-project?rev=38520&view=rev Log: Adjust this file per the new requirements of the configure scripts in llvm-top Modified: stacker/trunk/ModuleInfo.txt Modified: stacker/trunk/ModuleInfo.txt URL: http://llvm.org/viewvc/llvm-project/stacker/trunk/ModuleInfo.txt?rev=38520&r1=38519&r2=38520&view=diff ============================================================================== --- stacker/trunk/ModuleInfo.txt (original) +++ stacker/trunk/ModuleInfo.txt Tue Jul 10 21:59:25 2007 @@ -3,4 +3,6 @@ # Declare that stacker depends on llvm. DepModule: llvm - +ConfigCmd: ./configure --prefix=@INSTALL_PREFIX@ --with-llvmsrc=@LLVM_TOP@/llvm --with-llvmobj=@LLVM_TOP@/llvm +ConfigFile: ./config.status +BuildCmd: make build-for-llvm-top LLVM_TOP=@LLVM_TOP@ From reid at x10sys.com Tue Jul 10 22:00:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 03:00:11 -0000 Subject: [llvm-commits] [llvm] r38521 - /llvm/trunk/ModuleInfo.txt Message-ID: <200707110300.l6B30B5j026313@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 22:00:11 2007 New Revision: 38521 URL: http://llvm.org/viewvc/llvm-project?rev=38521&view=rev Log: Adjust this per the changes to the configuration script in the llvm-top module. Modified: llvm/trunk/ModuleInfo.txt Modified: llvm/trunk/ModuleInfo.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/ModuleInfo.txt?rev=38521&r1=38520&r2=38521&view=diff ============================================================================== --- llvm/trunk/ModuleInfo.txt (original) +++ llvm/trunk/ModuleInfo.txt Tue Jul 10 22:00:11 2007 @@ -1,2 +1,4 @@ DepModule: -BuildTarget: build-for-llvm-top +ConfigCmd: ./configure --prefix=@INSTALL_PREFIX@ --with-llvmgccdir=@LLVM_TOP@/install +ConfigFile: ./config.status +BuildCmd: make build-for-llvm-top LLVM_TOP=@LLVM_TOP@ From reid at x10sys.com Tue Jul 10 22:05:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 03:05:16 -0000 Subject: [llvm-commits] [hlvm] r38522 - /hlvm/trunk/ModuleInfo.txt Message-ID: <200707110305.l6B35G2m026435@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 22:05:15 2007 New Revision: 38522 URL: http://llvm.org/viewvc/llvm-project?rev=38522&view=rev Log: Update the entries per the configuration script changes in llvm-top. Modified: hlvm/trunk/ModuleInfo.txt Modified: hlvm/trunk/ModuleInfo.txt URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/ModuleInfo.txt?rev=38522&r1=38521&r2=38522&view=diff ============================================================================== --- hlvm/trunk/ModuleInfo.txt (original) +++ hlvm/trunk/ModuleInfo.txt Tue Jul 10 22:05:15 2007 @@ -1,2 +1,3 @@ -DepModule: llvm -BuildTarget: build-for-llvm-top +DepModule: llvm +# NOT IN REPOSITORY: llvm-gcc +BuildCmd: make build-for-llvm-top LLVM_TOP=@LLVM_TOP@ From reid at x10sys.com Tue Jul 10 22:07:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 03:07:28 -0000 Subject: [llvm-commits] [llvm-top] r38523 - /llvm-top/trunk/ Message-ID: <200707110307.l6B37SOI026497@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 22:07:28 2007 New Revision: 38523 URL: http://llvm.org/viewvc/llvm-project?rev=38523&view=rev Log: Ignore the module directories which are not recognized by svn because they are separate checkouts from other parts of the repository. Modified: llvm-top/trunk/ (props changed) Propchange: llvm-top/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Jul 10 22:07:28 2007 @@ -0,0 +1,4 @@ +hlvm +llvm +stacker +svn-commit*.tmp From reid at x10sys.com Tue Jul 10 22:39:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 03:39:16 -0000 Subject: [llvm-commits] [llvm-top] r38524 - in /llvm-top/trunk: build configure get library.sh Message-ID: <200707110339.l6B3dHht027393@zion.cs.uiuc.edu> Author: reid Date: Tue Jul 10 22:39:16 2007 New Revision: 38524 URL: http://llvm.org/viewvc/llvm-project?rev=38524&view=rev Log: Add the build script to build a module and its dependencies. Use the msg function instead of echo. Added: llvm-top/trunk/build (with props) Modified: llvm-top/trunk/configure (contents, props changed) llvm-top/trunk/get llvm-top/trunk/library.sh Added: llvm-top/trunk/build URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/build?rev=38524&view=auto ============================================================================== --- llvm-top/trunk/build (added) +++ llvm-top/trunk/build Tue Jul 10 22:39:16 2007 @@ -0,0 +1,86 @@ +#!/bin/sh +# build script +# +# This file was developed by Reid Spencer and is distributed under the +# University of Illinois Open Source License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# +# This script allows LLVM modules to be checked out, configured and built all in +# one step. Use it like this: +# +# cd llvm-top +# ./build {module_names} {configure_options} {build_options} +# +# where: +# {module_names} is a list of modules you want to configure (e.g. llvm, hlvm) +# {configure_options} start with -- and are passed to the configure tool +# of *all* the modules you are building that need configuration. +# {build_options} contain an = and are passed to the build tool of *all* +# the modules you are building. +# +# Note that the script will checkout and configure any dependent modules as well +# as the ones specified in {module_names} so it is only necessary to specify the +# minimal set you're interested in. + +# Get the library code +. ./library.sh + +# Process the arguments so that anything starting with - is passed down to the +# configure scripts while anything else is a module name. Collect the arguments +# in appropriate variables for later use. +for arg in "$@" ; do + case "$arg" in + --*) + CONFIGURE_ARGS="$CONFIGURE_ARGS $arg" + ;; + *=*) + BUILD_ARGS="$BUILD_ARGS $arg" + ;; + *) + MODULE_NAMES="$MODULE_NAMES $arg" + esac +done + +# Get (and possibly check out) the set of modules and their dependencies. This +# sets the MODULE_DEPENDENCIES variable to the set of module names that should +# be configured, in the correct order (least dependent first, no duplicates). +MODULE_DEPENDENCIES="" +get_dependencies $MODULE_NAMES + +build_module() { + module="$1" + build_opts="$2" + if test ! -d "$module" ; then + die 1 "Module $module did not get checked out!" + fi + LLVM_TOP=`pwd` + MODULE_INFO="$LLVM_TOP/$module/ModuleInfo.txt" + if test -f "$MODULE_INFO" ; then + build_command=`grep -i BuildCmd: $MODULE_INFO | sed -e 's/BuildCmd: //'` + fi + if test -z "$build_command" ; then + msg 0 "Module $module has no BuildCmd entry so it won't be built." + return 0 + fi + cd $module + build_command=`echo $build_command $build_opts | sed \ + -e "s#@LLVM_TOP@#$LLVM_TOP#g" \ + -e "s#@BUILD_OPTS@#$build_opts#g"` + if test "$?" -ne 0 ; then + die $? "Failed to generate build command" + fi + msg 0 "Building Module $module with this command:" + msg 0 " $build_command" + $build_command || die $? "Can't build $module" + cd $LLVM_TOP +} +# Now that we have a list of dependent modules, we must configure each of them +# according to the specifications of the module. +for mod in $MODULE_DEPENDENCIES ; do + configure_module "$mod" "$CONFIGURE_ARGS" + build_module "$mod" "$BUILD_ARGS" +done + +# Just indicate what modules we configured +msg 0 Modules built:"$MODULE_DEPENDENCIES". + Propchange: llvm-top/trunk/build ------------------------------------------------------------------------------ svn:executable = * Propchange: llvm-top/trunk/build ------------------------------------------------------------------------------ svn:execute = true Modified: llvm-top/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/configure?rev=38524&r1=38523&r2=38524&view=diff ============================================================================== --- llvm-top/trunk/configure (original) +++ llvm-top/trunk/configure Tue Jul 10 22:39:16 2007 @@ -49,4 +49,4 @@ done # Just indicate what modules we configured -echo Modules configured:"$MODULE_DEPENDENCIES". +msg 0 Modules configured:"$MODULE_DEPENDENCIES". Propchange: llvm-top/trunk/configure ------------------------------------------------------------------------------ svn:execute = true Modified: llvm-top/trunk/get URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/get?rev=38524&r1=38523&r2=38524&view=diff ============================================================================== --- llvm-top/trunk/get (original) +++ llvm-top/trunk/get Tue Jul 10 22:39:16 2007 @@ -15,4 +15,4 @@ get_dependencies "$@" # Report what happened. -echo Modules checked out:"$MODULE_DEPENDENCIES". +msg 0 Modules checked out:"$MODULE_DEPENDENCIES". Modified: llvm-top/trunk/library.sh URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/library.sh?rev=38524&r1=38523&r2=38524&view=diff ============================================================================== --- llvm-top/trunk/library.sh (original) +++ llvm-top/trunk/library.sh Tue Jul 10 22:39:16 2007 @@ -126,3 +126,4 @@ fi cd $LLVM_TOP } + From clattner at apple.com Wed Jul 11 00:05:00 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 10 Jul 2007 22:05:00 -0700 Subject: [llvm-commits] [llvm] r38517 - in /llvm/trunk: include/llvm/LinkAllPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/FastDSE.cpp In-Reply-To: <200707110046.l6B0kIWe023024@zion.cs.uiuc.edu> References: <200707110046.l6B0kIWe023024@zion.cs.uiuc.edu> Message-ID: > Add FastDSE, a new algorithm for doing dead store elimination. > This algorithm is not as accurate > as the current DSE, but it only a linear scan over each block, > rather than quadratic. Eventually > (once it has been improved somewhat), this will replace the current > DSE. Woot. > +//===- DeadStoreElimination.cpp - Dead Store Elimination > ------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file was developed by the LLVM research group and is > distributed under s/LLVM research group/the amazing and unpredictable owen/ > +FunctionPass *llvm::createFastDeadStoreEliminationPass() { return > new FDSE(); } > + > +bool FDSE::runOnBasicBlock(BasicBlock &BB) { > + MemoryDependenceAnalysis& MD = > getAnalysis(); > + > + DenseMap lastStore; > + SetVector possiblyDead; Please add comments describing what these are and what they contain at any point in time. > + 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... > + if (StoreInst* S = dyn_cast(BBI)) { Since you only look at stores, I suggest structuring this loop like this to reduce nesting (which makes it easier to read the code): > + for (BasicBlock::iterator BBI = BB.begin(), BBE = BB.end(); BBI ! > = BBE; ++BBI) { > + // If we find a store... > + StoreInst* S = dyn_cast(BBI); > + if (!S) continue; ... > + > + // ... to a pointer that has been stored to before... > + if (lastStore.count(S->getPointerOperand())) { > + StoreInst* last = lastStore[S->getPointerOperand()]; This does two hashtable lookups, and the insert below does another. I'd suggest just doing: StoreInst *&last = lastStore[S->getPointerOperand()]; if (last) { ... } last = S; > + // ... and no other memory dependencies are between them.... > + if (MD.getDependency(S) == last) { > + // Remove it! > + MD.removeInstruction(last); > + > + // DCE instructions only used to calculate that store > + if (Instruction* D = dyn_cast(last- > >getOperand(0))) > + possiblyDead.insert(D); > + > + last->eraseFromParent(); > + NumFastStores++; > + MadeChange = true; > + } > + } Nice and simple! > + // Update our most-recent-store map > + lastStore.insert(std::make_pair(S->getPointerOperand(), S)); > + } > + } > + > + // Do a trivial DCE > + while (!possiblyDead.empty()) { > + Instruction *I = possiblyDead.back(); > + possiblyDead.pop_back(); > + DeleteDeadInstructionChains(I, possiblyDead); > + } > + > + return MadeChange; > +} > + > +void FDSE::DeleteDeadInstructionChains(Instruction *I, > + SetVector > &DeadInsts) { > + // Instruction must be dead. > + if (!I->use_empty() || !isInstructionTriviallyDead(I)) return; > + > + // Let the memory dependence know > + getAnalysis().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 (Instruction *Op = dyn_cast(I->getOperand(i))) > + DeadInsts.insert(Op); // Attempt to nuke it later. > + I->setOperand(i, 0); // Drop from the operand list. With this design, there is no reason to call setOperand. You probably want something like this: > + for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) { > + if (I->getOperand(i)->hasOneUse()) > + if (Instruction *Op = dyn_cast(I->getOperand(i))) > + DeadInsts.insert(Op); // Attempt to nuke it later. > + I->setOperand(i, 0); // Drop from the operand list. Otherwise, nice work! How fast is this on the slow bugzilla case compared to slow dse? -Chris > + } > + > + I->eraseFromParent(); > + ++NumFastOther; > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Wed Jul 11 00:28:40 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 11 Jul 2007 05:28:40 -0000 Subject: [llvm-commits] [llvm] r38525 - /llvm/trunk/lib/CodeGen/VirtRegMap.cpp Message-ID: <200707110528.l6B5SeOm030525@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jul 11 00:28:39 2007 New Revision: 38525 URL: http://llvm.org/viewvc/llvm-project?rev=38525&view=rev Log: Fix for PR1545: Revamp code that update kill information due to register reuse. Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=38525&r1=38524&r2=38525&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Wed Jul 11 00:28:39 2007 @@ -629,6 +629,63 @@ } +/// 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 &KillOps) { + for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { + MachineOperand &MO = MI.getOperand(i); + if (!MO.isReg() || !MO.isUse() || !MO.isKill()) + continue; + unsigned Reg = MO.getReg(); + if (KillOps[Reg] == &MO) { + RegKills.reset(Reg); + KillOps[Reg] = NULL; + } + } +} + +/// 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 &KillOps) { + const TargetInstrDescriptor *TID = MI.getInstrDescriptor(); + for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { + MachineOperand &MO = MI.getOperand(i); + if (!MO.isReg() || !MO.isUse()) + continue; + unsigned Reg = MO.getReg(); + if (Reg == 0) + continue; + + if (RegKills[Reg]) { + // That can't be right. Register is killed but not re-defined and it's + // being reused. Let's fix that. + KillOps[Reg]->unsetIsKill(); + if (i < TID->numOperands && + 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.isReg() || !MO.isDef()) + continue; + unsigned Reg = MO.getReg(); + RegKills.reset(Reg); + KillOps[Reg] = NULL; + } +} + + /// rewriteMBB - Keep track of which spills are available even after the /// register allocator is done with them. If possible, avoid reloading vregs. void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM, @@ -647,11 +704,20 @@ // same stack slot, the original store is deleted. std::map MaybeDeadStores; + // Keep track of kill information. + BitVector RegKills(MRI->getNumRegs()); + std::vector KillOps; + KillOps.resize(MRI->getNumRegs(), NULL); + MachineFunction &MF = *MBB.getParent(); for (MachineBasicBlock::iterator MII = MBB.begin(), E = MBB.end(); MII != E; ) { MachineInstr &MI = *MII; MachineBasicBlock::iterator NextMII = MII; ++NextMII; + VirtRegMap::MI2VirtMapTy::const_iterator I, End; + + bool Erased = false; + bool BackTracked = false; /// ReusedOperands - Keep track of operand reuse in case we need to undo /// reuse. @@ -665,26 +731,25 @@ int FrameIdx; if (TII->isTriviallyReMaterializable(&MI) || TII->isLoadFromStackSlot(&MI, FrameIdx)) { - bool Remove = true; + Erased = true; 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. if (MO.isDef() && !VRM.isReMaterialized(MO.getReg())) { - Remove = false; + Erased = false; break; } } - if (Remove) { + if (Erased) { VRM.RemoveFromFoldedVirtMap(&MI); ReMatedMIs.push_back(MI.removeFromParent()); - MII = NextMII; - continue; + goto ProcessNextInst; } } - const unsigned *ImpDef = TID->ImplicitDefs; - if (ImpDef) { + if (TID->ImplicitDefs) { + const unsigned *ImpDef = TID->ImplicitDefs; for ( ; *ImpDef; ++ImpDef) { MF.setPhysRegUsed(*ImpDef); ReusedOperands.markClobbered(*ImpDef); @@ -760,24 +825,8 @@ << MRI->getName(VRM.getPhys(VirtReg)) << "\n"; MI.getOperand(i).setReg(PhysReg); - // Extend the live range of the MI that last kill the register if - // necessary. - bool WasKill = false; - if (SSMI) { - int UIdx = SSMI->findRegisterUseOperandIdx(PhysReg, true); - if (UIdx != -1) { - MachineOperand &MOK = SSMI->getOperand(UIdx); - WasKill = MOK.isKill(); - MOK.unsetIsKill(); - } - } - if (ti == -1) { - // Unless it's the use of a two-address code, transfer the kill - // of the reused register to this use. - if (WasKill) - MI.getOperand(i).setIsKill(); + if (ti == -1) Spills.addLastUse(PhysReg, &MI); - } // 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 @@ -847,23 +896,8 @@ // Extend the live range of the MI that last kill the register if // necessary. - bool WasKill = false; - if (SSMI) { - int UIdx = SSMI->findRegisterUseOperandIdx(PhysReg, true); - if (UIdx != -1) { - MachineOperand &MOK = SSMI->getOperand(UIdx); - WasKill = MOK.isKill(); - MOK.unsetIsKill(); - } - } MachineInstr *CopyMI = prior(MII); - if (WasKill) { - // Transfer kill to the next use. - int UIdx = CopyMI->findRegisterUseOperandIdx(PhysReg); - assert(UIdx != -1); - MachineOperand &MOU = CopyMI->getOperand(UIdx); - MOU.setIsKill(); - } + UpdateKills(*CopyMI, RegKills, KillOps); Spills.addLastUse(PhysReg, CopyMI); // This invalidates DesignatedReg. @@ -910,6 +944,7 @@ if (TID->getOperandConstraint(i, TOI::TIED_TO) == -1) MI.getOperand(i).setIsKill(); MI.getOperand(i).setReg(PhysReg); + UpdateKills(*prior(MII), RegKills, KillOps); DOUT << '\t' << *prior(MII); } @@ -918,7 +953,6 @@ // 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 - VirtRegMap::MI2VirtMapTy::const_iterator I, End; for (tie(I, End) = VRM.getFoldedVirts(&MI); I != End; ++I) { DOUT << "Folded vreg: " << I->second.first << " MR: " << I->second.second; @@ -950,39 +984,21 @@ // 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; - // Either way, the live range of the last kill of InReg has been - // extended. Remove its kill. - bool WasKill = false; - if (SSMI) { - int UIdx = SSMI->findRegisterUseOperandIdx(InReg, true); - if (UIdx != -1) { - MachineOperand &MOK = SSMI->getOperand(UIdx); - WasKill = MOK.isKill(); - MOK.unsetIsKill(); - } - } if (NextMII != MBB.end()) { // If NextMII uses InReg and the use is not a two address // operand, mark it killed. int UIdx = NextMII->findRegisterUseOperandIdx(InReg); - if (UIdx != -1) { - MachineOperand &MOU = NextMII->getOperand(UIdx); - if (WasKill) { - const TargetInstrDescriptor *NTID = - NextMII->getInstrDescriptor(); - if (UIdx >= NTID->numOperands || - NTID->getOperandConstraint(UIdx, TOI::TIED_TO) == -1) - MOU.setIsKill(); - } + if (UIdx != -1) Spills.addLastUse(InReg, &(*NextMII)); - } } VRM.RemoveFromFoldedVirtMap(&MI); MBB.erase(&MI); + Erased = true; goto ProcessNextInst; } } @@ -999,6 +1015,7 @@ // If we get here, the store is dead, nuke it now. assert(VirtRegMap::isMod && "Can't be modref!"); DOUT << "Removed dead store:\t" << *MDSI->second; + InvalidateKills(*MDSI->second, RegKills, KillOps); MBB.erase(MDSI->second); VRM.RemoveFromFoldedVirtMap(MDSI->second); MaybeDeadStores.erase(MDSI); @@ -1050,6 +1067,7 @@ DOUT << "Removing now-noop copy: " << MI; Spills.removeLastUse(Src, &MI); MBB.erase(&MI); + Erased = true; VRM.RemoveFromFoldedVirtMap(&MI); Spills.disallowClobberPhysReg(VirtReg); goto ProcessNextInst; @@ -1104,6 +1122,7 @@ if (LastStore) { DOUT << "Removed dead store:\t" << *LastStore; ++NumDSE; + InvalidateKills(*LastStore, RegKills, KillOps); MBB.erase(LastStore); VRM.RemoveFromFoldedVirtMap(LastStore); } @@ -1126,6 +1145,7 @@ DOUT << "Removing now-noop copy: " << MI; Spills.removeLastUse(Src, &MI); MBB.erase(&MI); + Erased = true; VRM.RemoveFromFoldedVirtMap(&MI); goto ProcessNextInst; } @@ -1133,12 +1153,14 @@ } } 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!"); From reid at x10sys.com Wed Jul 11 02:26:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 07:26:02 -0000 Subject: [llvm-commits] [llvm-top] r38529 - /llvm-top/trunk/cfe/trunk/ModuleInfo.txt Message-ID: <200707110726.l6B7Q2gV001283@zion.cs.uiuc.edu> Author: reid Date: Wed Jul 11 02:26:01 2007 New Revision: 38529 URL: http://llvm.org/viewvc/llvm-project?rev=38529&view=rev Log: Add a comment describing what this file is for. Modified: llvm-top/trunk/cfe/trunk/ModuleInfo.txt Modified: llvm-top/trunk/cfe/trunk/ModuleInfo.txt URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/cfe/trunk/ModuleInfo.txt?rev=38529&r1=38528&r2=38529&view=diff ============================================================================== --- llvm-top/trunk/cfe/trunk/ModuleInfo.txt (original) +++ llvm-top/trunk/cfe/trunk/ModuleInfo.txt Wed Jul 11 02:26:01 2007 @@ -1,3 +1,4 @@ +# Module information for llvm-top usage DepModule: llvm ConfigCmd: ./configure --prefix=@INSTALL_PREFIX@ --with-llvmsrc=@LLVM_TOP@/llvm --with-llvmobj=@LLVM_TOP@/llvm ConfigFile: ./config.status From reid at x10sys.com Wed Jul 11 02:40:43 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Jul 2007 07:40:43 -0000 Subject: [llvm-commits] [llvm-top] r38530 - /llvm-top/trunk/cfe/ Message-ID: <200707110740.l6B7ehBJ001608@zion.cs.uiuc.edu> Author: reid Date: Wed Jul 11 02:40:41 2007 New Revision: 38530 URL: http://llvm.org/viewvc/llvm-project?rev=38530&view=rev Log: Delete this, its in the wrong place Removed: llvm-top/trunk/cfe/ From evan.cheng at apple.com Wed Jul 11 03:47:44 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 11 Jul 2007 08:47:44 -0000 Subject: [llvm-commits] [llvm] r38534 - /llvm/trunk/lib/CodeGen/VirtRegMap.cpp Message-ID: <200707110847.l6B8liIe003028@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jul 11 03:47:44 2007 New Revision: 38534 URL: http://llvm.org/viewvc/llvm-project?rev=38534&view=rev Log: No longer need to track last def / use. Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=38534&r1=38533&r2=38534&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Wed Jul 11 03:47:44 2007 @@ -277,10 +277,8 @@ // SpillSlotsAvailable - This map keeps track of all of the spilled virtual // register values that are still available, due to being loaded or stored to, - // but not invalidated yet. It also tracks the instructions that defined - // or used the register. - typedef std::pair > SSInfo; - std::map SpillSlotsAvailable; + // but not invalidated yet. + std::map SpillSlotsAvailable; // PhysRegsAvailable - This is the inverse of SpillSlotsAvailable, indicating // which stack slot values are currently held by a physreg. This is used to @@ -298,56 +296,15 @@ const MRegisterInfo *getRegInfo() const { return MRI; } /// getSpillSlotPhysReg - If the specified stack slot is available in a - /// physical register, return that PhysReg, otherwise return 0. It also - /// returns by reference the instruction that either defines or last uses - /// the register. - unsigned getSpillSlotPhysReg(int Slot, MachineInstr *&SSMI) const { - std::map::const_iterator I = SpillSlotsAvailable.find(Slot); + /// physical register, return that PhysReg, otherwise return 0. + unsigned getSpillSlotPhysReg(int Slot) const { + std::map::const_iterator I = SpillSlotsAvailable.find(Slot); if (I != SpillSlotsAvailable.end()) { - if (!I->second.second.empty()) - SSMI = I->second.second.back(); - return I->second.first >> 1; // Remove the CanClobber bit. + return I->second >> 1; // Remove the CanClobber bit. } return 0; } - /// addLastUse - Add the last use information of all stack slots whose - /// values are available in the specific register. - void addLastUse(unsigned PhysReg, MachineInstr *Use) { - std::multimap::iterator I = - PhysRegsAvailable.lower_bound(PhysReg); - while (I != PhysRegsAvailable.end() && I->first == PhysReg) { - int Slot = I->second; - I++; - - std::map::iterator II = SpillSlotsAvailable.find(Slot); - assert(II != SpillSlotsAvailable.end() && "Slot not available!"); - unsigned Val = II->second.first; - assert((Val >> 1) == PhysReg && "Bidirectional map mismatch!"); - // This can be true if there are multiple uses of the same register. - if (II->second.second.back() != Use) - II->second.second.push_back(Use); - } - } - - /// removeLastUse - Remove the last use information of all stack slots whose - /// values are available in the specific register. - void removeLastUse(unsigned PhysReg, MachineInstr *Use) { - std::multimap::iterator I = - PhysRegsAvailable.lower_bound(PhysReg); - while (I != PhysRegsAvailable.end() && I->first == PhysReg) { - int Slot = I->second; - I++; - - std::map::iterator II = SpillSlotsAvailable.find(Slot); - assert(II != SpillSlotsAvailable.end() && "Slot not available!"); - unsigned Val = II->second.first; - assert((Val >> 1) == PhysReg && "Bidirectional map mismatch!"); - if (II->second.second.back() == Use) - II->second.second.pop_back(); - } - } - /// addAvailable - Mark that the specified stack slot 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. @@ -358,10 +315,7 @@ ModifyStackSlot(Slot); PhysRegsAvailable.insert(std::make_pair(Reg, Slot)); - std::vector DefUses; - DefUses.push_back(MI); - SpillSlotsAvailable[Slot] = - std::make_pair((Reg << 1) | (unsigned)CanClobber, DefUses); + SpillSlotsAvailable[Slot] = (Reg << 1) | (unsigned)CanClobber; if (Slot > VirtRegMap::MAX_STACK_SLOT) DOUT << "Remembering RM#" << Slot-VirtRegMap::MAX_STACK_SLOT-1; @@ -375,7 +329,7 @@ /// stack slot must be available in a physreg for this query to make sense. bool canClobberPhysReg(int Slot) const { assert(SpillSlotsAvailable.count(Slot) && "Slot not available!"); - return SpillSlotsAvailable.find(Slot)->second.first & 1; + return SpillSlotsAvailable.find(Slot)->second & 1; } /// disallowClobberPhysReg - Unset the CanClobber bit of the specified @@ -404,9 +358,9 @@ while (I != PhysRegsAvailable.end() && I->first == PhysReg) { int Slot = I->second; I++; - assert((SpillSlotsAvailable[Slot].first >> 1) == PhysReg && + assert((SpillSlotsAvailable[Slot] >> 1) == PhysReg && "Bidirectional map mismatch!"); - SpillSlotsAvailable[Slot].first &= ~1; + SpillSlotsAvailable[Slot] &= ~1; DOUT << "PhysReg " << MRI->getName(PhysReg) << " copied, it is available for use but can no longer be modified\n"; } @@ -429,7 +383,7 @@ while (I != PhysRegsAvailable.end() && I->first == PhysReg) { int Slot = I->second; PhysRegsAvailable.erase(I++); - assert((SpillSlotsAvailable[Slot].first >> 1) == PhysReg && + assert((SpillSlotsAvailable[Slot] >> 1) == PhysReg && "Bidirectional map mismatch!"); SpillSlotsAvailable.erase(Slot); DOUT << "PhysReg " << MRI->getName(PhysReg) @@ -454,9 +408,9 @@ /// changes. This removes information about which register the previous value /// for this slot lives in (as the previous value is dead now). void AvailableSpills::ModifyStackSlot(int Slot) { - std::map::iterator It = SpillSlotsAvailable.find(Slot); + std::map::iterator It = SpillSlotsAvailable.find(Slot); if (It == SpillSlotsAvailable.end()) return; - unsigned Reg = It->second.first >> 1; + unsigned Reg = It->second >> 1; SpillSlotsAvailable.erase(It); // This register may hold the value of multiple stack slots, only remove this @@ -794,8 +748,7 @@ unsigned PhysReg; // Check to see if this stack slot is available. - MachineInstr *SSMI = NULL; - if ((PhysReg = Spills.getSpillSlotPhysReg(StackSlot, SSMI))) { + if ((PhysReg = Spills.getSpillSlotPhysReg(StackSlot))) { // 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 @@ -825,9 +778,6 @@ << MRI->getName(VRM.getPhys(VirtReg)) << "\n"; MI.getOperand(i).setReg(PhysReg); - if (ti == -1) - Spills.addLastUse(PhysReg, &MI); - // 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'. @@ -894,11 +844,8 @@ ReusedOperands.markClobbered(DesignatedReg); MRI->copyRegToReg(MBB, &MI, DesignatedReg, PhysReg, RC); - // Extend the live range of the MI that last kill the register if - // necessary. MachineInstr *CopyMI = prior(MII); UpdateKills(*CopyMI, RegKills, KillOps); - Spills.addLastUse(PhysReg, CopyMI); // This invalidates DesignatedReg. Spills.ClobberPhysReg(DesignatedReg); @@ -973,8 +920,7 @@ if (FrameIdx == SS) { // If this spill slot is available, turn it into a copy (or nothing) // instead of leaving it as a load! - MachineInstr *SSMI = NULL; - if (unsigned InReg = Spills.getSpillSlotPhysReg(SS, SSMI)) { + if (unsigned InReg = Spills.getSpillSlotPhysReg(SS)) { DOUT << "Promoted Load To Copy: " << MI; if (DestReg != InReg) { MRI->copyRegToReg(MBB, &MI, DestReg, InReg, @@ -988,14 +934,6 @@ } else DOUT << "Removing now-noop copy: " << MI; - if (NextMII != MBB.end()) { - // If NextMII uses InReg and the use is not a two address - // operand, mark it killed. - int UIdx = NextMII->findRegisterUseOperandIdx(InReg); - if (UIdx != -1) - Spills.addLastUse(InReg, &(*NextMII)); - } - VRM.RemoveFromFoldedVirtMap(&MI); MBB.erase(&MI); Erased = true; @@ -1065,7 +1003,6 @@ if (TII->isMoveInstr(MI, Src, Dst) && Src == Dst) { ++NumDCE; DOUT << "Removing now-noop copy: " << MI; - Spills.removeLastUse(Src, &MI); MBB.erase(&MI); Erased = true; VRM.RemoveFromFoldedVirtMap(&MI); @@ -1143,7 +1080,6 @@ if (TII->isMoveInstr(MI, Src, Dst) && Src == Dst) { ++NumDCE; DOUT << "Removing now-noop copy: " << MI; - Spills.removeLastUse(Src, &MI); MBB.erase(&MI); Erased = true; VRM.RemoveFromFoldedVirtMap(&MI); From baldrick at free.fr Wed Jul 11 03:47:55 2007 From: baldrick at free.fr (Duncan Sands) Date: Wed, 11 Jul 2007 08:47:55 -0000 Subject: [llvm-commits] [llvm] r38535 - /llvm/trunk/lib/CodeGen/BranchFolding.cpp Message-ID: <200707110847.l6B8ltLL003045@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 11 03:47:55 2007 New Revision: 38535 URL: http://llvm.org/viewvc/llvm-project?rev=38535&view=rev Log: If assertions are not enabled, we should return False here. Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=38535&r1=38534&r2=38535&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Wed Jul 11 03:47:55 2007 @@ -430,13 +430,12 @@ else if (p.second->getNumber() > q.second->getNumber()) return false; else { - // _GLIBCXX_DEBUG needs to check strict weak ordering and it - // does it by doing a compare on the same object. -#ifdef _GLIBCXX_DEBUG - 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); } } From baldrick at free.fr Wed Jul 11 04:43:53 2007 From: baldrick at free.fr (Duncan Sands) Date: Wed, 11 Jul 2007 11:43:53 +0200 Subject: [llvm-commits] [llvm] r38506 - in /llvm/trunk: lib/VMCore/Verifier.cpp test/Verifier/byval-1.ll test/Verifier/byval-2.ll test/Verifier/byval-3.ll test/Verifier/byval-4.ll In-Reply-To: <200707101928.l6AJSRK8012105@zion.cs.uiuc.edu> References: <200707101928.l6AJSRK8012105@zion.cs.uiuc.edu> Message-ID: <200707111143.54196.baldrick@free.fr> Hi Rafael, > + Assert(!Attrs->paramHasAttr(0, ParamAttr::ByVal), > + "Attribute ByVal should not apply to functions!"); why not? > + "Attribute ByVal should only apply to pointer to structs!", &F); Why? Why are arrays not allowed? Here's my take on this whole area. Perhaps I'm just confused :) On some targets the ABI specifies that C functions that take a by-copy struct argument that is sufficiently small should pass it in registers, or maybe on the stack. Likewise, on some targets the ABI specifies that a function that returns a struct should return it in certain registers or on the stack (StructReturn attribute). On other targets, by-copy struct arguments are passed by passing pointer to a copy, or by passing a pointer to the original struct with a copy being made in the callee, I don't know which. Likewise, on targets with nothing specified for StructReturn in the ABI, the value is returned by writing through a pointer into a struct supplied by the caller. [ByVal and StructReturn are closely related, so maybe we should change the names: ByVal -> CopyIn, StructReturn -> CopyOut]. Note that the representation in the IR is "by reference": a pointer to the struct is passed: declare void @h(%struct.foo* byval %num) I think ByVal should mean: if the struct is compatible with the ABI's way of passing structs by-copy, then pass using this method, otherwise pass by reference. At the level of the target independent IR, it would be *undefined* as to whether a ByVal parameter is in fact passed by reference or by copy. My understanding is that this is exactly how StructReturn works: if, before calling the function, you write to the struct that is passed in as the StructReturn parameter, and then you try reading from the struct inside the function you may (returned by reference) or may not (returned by copy) see the values you previously wrote. Thus on some targets ByVal parameters would always be passed by reference. On others, small structs would be passed by copy, large ones by reference. On others, all structs would be passed by copy. Disadvantages of this scheme: (1) in order to implement C semantics of passing a struct by copy [which requires that a copy always be made, regardless of the size of the struct], it would be necessary to, for example, pass the parameter ByVal, immediately make a copy of the struct inside the function, and use the copy everywhere inside the function. This would always give the correct semantics while being compatible with ABI requirements (thanks to the ByVal). The downside is that in cases when the ByVal parameter is in fact passed by copy, an unnecessary copy is being made. Hopefully the codegen optimizers can be taught to remove the pointless copy in this case. Thus the disadvantage is: additional work may be needed on the codegen optimizers to get this to work optimally. Advantages of this scheme: (1) it doesn't *require* any changes to the target independent optimizers, eg to alias analysis, the inliner and who knows what else: they can just ignore the ByVal attribute, which amounts to considering the struct to have been passed by reference (which is how it is represented in the IR). Now, you might want to enhance the optimizers so they can exploit the undefinedness of whether the struct is passed by reference or by copy, but this is optional can be implemented incrementally. It seems to me that this is much much better than having to say in various places: ok, this thing looks like a pointer but it's not really a pointer! That way lies madness. If I dare say so, that way lies... gcc! (2) targets that don't have a special way of passing structs by-copy don't have to do anything. (3) if a function is known not to write to a struct parameter, then that parameter could be marked ByVal, meaning that it will (hopefully) get passed by the most efficient method for the target (in registers). I say hopefully, because I suppose some ABIs may specify that by-copy structs of any size must be passed on the stack, which would mean that promoting a parameter to ByVal could result in a slowdown rather than a speedup. (4) it conceptually unifies the treatment of ByVal and StructReturn parameters. Ciao, Duncan. From asl at math.spbu.ru Wed Jul 11 05:29:07 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 11 Jul 2007 14:29:07 +0400 Subject: [llvm-commits] [llvm] r38534 - /llvm/trunk/lib/CodeGen/VirtRegMap.cpp In-Reply-To: <200707110847.l6B8liIe003028.SS9688SS@zion.cs.uiuc.edu> References: <200707110847.l6B8liIe003028.SS9688SS@zion.cs.uiuc.edu> Message-ID: <1184149747.9240.156.camel@asl.dorms.spbu.ru> Hello, Evan > No longer need to track last def / use. Late night hacking broke things(tm) :) Testcase is attached. Run it via 'llc -mcpu=athlon'. PS: Bugzilla doesn't answer right now, thus posting here. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: bugpoint-reduced-simplified.bc Type: application/octet-stream Size: 872 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070711/89d1f340/attachment.obj From gabor at mac.com Wed Jul 11 07:36:24 2007 From: gabor at mac.com (Gabor Greif) Date: Wed, 11 Jul 2007 14:36:24 +0200 Subject: [llvm-commits] PATCH: regarding PR1546 Message-ID: <4694CEC8.906@mac.com> I do not consider PR1546 closed just yet. What I mentioned in the PR was only two of ca. 140 Solaris failures. Most of them complain that llc cannot choose between C and MSIL output formats. The below prototypical patch corrects this type of failure. Is this the right way of handling it? Why does llc only fail on Solaris and not on Darwin? After I understood this problem I am happy to commit these 100+ files. Cheers, Gabor Index: /home/ggreif/llvm/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll =================================================================== --- /home/ggreif/llvm/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll (revision 38488) +++ /home/ggreif/llvm/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll (working copy) @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc +; RUN: llvm-upgrade < %s | llvm-as | llc -march=c ; Test that llvm.memcpy works with a i64 length operand on all targets. From asl at math.spbu.ru Wed Jul 11 11:04:47 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 11 Jul 2007 20:04:47 +0400 Subject: [llvm-commits] PATCH: regarding PR1546 In-Reply-To: <4694CEC8.906.SS1115SS@mac.com> References: <4694CEC8.906.SS1115SS@mac.com> Message-ID: <1184169887.9240.158.camel@asl.dorms.spbu.ru> Hello, Gabor. > The below prototypical patch corrects this type of failure. It seems, that this is not correct patch. I think the idea was to let llc select current target and generate code for it. > Why does llc only fail on Solaris and not on Darwin? I think because we handle darwin+elf+cygming+windows 'subtargets' on x86. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From alenhar2 at cs.uiuc.edu Wed Jul 11 11:15:25 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 11 Jul 2007 16:15:25 -0000 Subject: [llvm-commits] [poolalloc] r38536 - in /poolalloc/branches/SVA: include/dsa/DSGraph.h include/dsa/DSNode.h lib/DSA/DataStructure.cpp lib/DSA/Local.cpp Message-ID: <200707111615.l6BGFPV4018619@zion.cs.uiuc.edu> Author: alenhar2 Date: Wed Jul 11 11:15:24 2007 New Revision: 38536 URL: http://llvm.org/viewvc/llvm-project?rev=38536&view=rev Log: More llva support, try alternate ways of tracking flags on MP. Modified: poolalloc/branches/SVA/include/dsa/DSGraph.h poolalloc/branches/SVA/include/dsa/DSNode.h poolalloc/branches/SVA/lib/DSA/DataStructure.cpp poolalloc/branches/SVA/lib/DSA/Local.cpp Modified: poolalloc/branches/SVA/include/dsa/DSGraph.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/include/dsa/DSGraph.h?rev=38536&r1=38535&r2=38536&view=diff ============================================================================== --- poolalloc/branches/SVA/include/dsa/DSGraph.h (original) +++ poolalloc/branches/SVA/include/dsa/DSGraph.h Wed Jul 11 11:15:24 2007 @@ -143,7 +143,7 @@ if (I != ValueMap.end()) return I->second; // Return value if already exists. - if (GlobalValue *GV = dyn_cast(V)) + if (GlobalValue *GV = dyn_cast(V)) return AddGlobal(GV); return ValueMap.insert(std::make_pair(V, DSNodeHandle())).first->second; Modified: poolalloc/branches/SVA/include/dsa/DSNode.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/include/dsa/DSNode.h?rev=38536&r1=38535&r2=38536&view=diff ============================================================================== --- poolalloc/branches/SVA/include/dsa/DSNode.h (original) +++ poolalloc/branches/SVA/include/dsa/DSNode.h Wed Jul 11 11:15:24 2007 @@ -29,6 +29,7 @@ protected: Value *MPD; MetaPool* fw; + unsigned Flags; public: std::list allocs; @@ -44,9 +45,15 @@ GVs.push_back(GV); } - MetaPool() : MPD(0),fw(0) {} - MetaPool(const MetaPool& M) :MPD(0), fw(const_cast(&M)) {} + MetaPool() : MPD(0),fw(0),Flags(0) {} + MetaPool(const MetaPool& M) :MPD(0), fw(const_cast(&M)), Flags(0) {} + void addFlags(unsigned f) { + Flags |= f; + } + unsigned getFlags() const { + return Flags; + } Value * getMetaPoolValue() { return MPD; } @@ -58,6 +65,7 @@ allocs.splice(allocs.begin(), M->allocs); GVs.splice(GVs.begin(), M->GVs); M->fw = this; + addFlags(M->Flags); } MetaPool* getFW() { return fw; } }; @@ -81,8 +89,6 @@ }; #endif - - //===----------------------------------------------------------------------===// /// DSNode - Data structure node class /// @@ -414,16 +420,16 @@ bool isDeadNode() const { return NodeType & DEAD; } bool isExternalNode() const { return NodeType & External; } - DSNode *setAllocaNodeMarker() { NodeType |= AllocaNode; return this; } - DSNode *setHeapNodeMarker() { NodeType |= HeapNode; return this; } - DSNode *setGlobalNodeMarker() { NodeType |= GlobalNode; return this; } - DSNode *setUnknownNodeMarker() { NodeType |= UnknownNode; return this; } - - DSNode *setExternalMarker() { NodeType |= External; return this; } - DSNode *setIncompleteMarker() { NodeType |= Incomplete; return this; } - DSNode *setModifiedMarker() { NodeType |= Modified; return this; } - DSNode *setReadMarker() { NodeType |= Read; return this; } - DSNode *setArrayMarker() { NodeType |= Array; return this; } + DSNode *setAllocaNodeMarker() { NodeType |= AllocaNode; getMP()->addFlags(NodeType); return this; } + DSNode *setHeapNodeMarker() { NodeType |= HeapNode; getMP()->addFlags(NodeType); return this; } + DSNode *setGlobalNodeMarker() { NodeType |= GlobalNode; getMP()->addFlags(NodeType); return this; } + DSNode *setUnknownNodeMarker(); // { ++stat_unknown; NodeType |= UnknownNode; return this; } + + DSNode *setExternalMarker() { NodeType |= External; getMP()->addFlags(NodeType); return this; } + DSNode *setIncompleteMarker() { NodeType |= Incomplete; getMP()->addFlags(NodeType); return this; } + DSNode *setModifiedMarker() { NodeType |= Modified; getMP()->addFlags(NodeType); return this; } + DSNode *setReadMarker() { NodeType |= Read; getMP()->addFlags(NodeType); return this; } + DSNode *setArrayMarker() { NodeType |= Array; getMP()->addFlags(NodeType); return this; } void makeNodeDead() { Globals.clear(); Modified: poolalloc/branches/SVA/lib/DSA/DataStructure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/DSA/DataStructure.cpp?rev=38536&r1=38535&r2=38536&view=diff ============================================================================== --- poolalloc/branches/SVA/lib/DSA/DataStructure.cpp (original) +++ poolalloc/branches/SVA/lib/DSA/DataStructure.cpp Wed Jul 11 11:15:24 2007 @@ -218,10 +218,9 @@ std::vector::iterator I = std::lower_bound(Globals.begin(), Globals.end(), GV); - if (I == Globals.end() || *I != GV) { + if (I == Globals.end() || *I != GV) Globals.insert(I, GV); - NodeType |= GlobalNode; - } + NodeType |= GlobalNode; } // removeGlobal - Remove the specified global that is explicitly in the globals @@ -823,6 +822,8 @@ void DSNode::mergeGlobals(const std::vector &RHS) { MergeSortedVectors(Globals, RHS); + if (Globals.size()) + setGlobalNodeMarker(); } // MergeNodes - Helper function for DSNode::mergeWith(). Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/DSA/Local.cpp?rev=38536&r1=38535&r2=38536&view=diff ============================================================================== --- poolalloc/branches/SVA/lib/DSA/Local.cpp (original) +++ poolalloc/branches/SVA/lib/DSA/Local.cpp Wed Jul 11 11:15:24 2007 @@ -40,6 +40,7 @@ static Statistic<> CacheAllocs ("dsa", "Number of kmem_cache_alloc calls"); static Statistic<> KMallocs ("dsa", "Number of kmalloc calls"); static Statistic<> GlobalPools ("dsa", "Number of global pools"); +std::map syscalls; #endif Statistic<> stat_unknown ("dsa", "Number of markunknowns"); @@ -55,6 +56,7 @@ ++CrashCur; ++stat_unknown; NodeType |= UnknownNode; + getMP()->addFlags(NodeType); return this; } @@ -151,7 +153,7 @@ } visit(f); // Single pass over the function -#if JTC +#if 0 std::cerr << "LLVA: Function " << f.getName() << "\n"; for (DSScalarMap::iterator I = ScalarMap.begin(), E=ScalarMap.end(); I != E; @@ -388,7 +390,7 @@ void GraphBuilder::visitPHINode(PHINode &PN) { if (!isPointerType(PN.getType())) return; // Only pointer PHIs - DSNodeHandle &PNDest = ScalarMap[&PN]; + DSNodeHandle PNDest = getValueDest(PN); for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) PNDest.mergeWith(getValueDest(*PN.getIncomingValue(i))); } @@ -396,7 +398,7 @@ void GraphBuilder::visitSelectInst(SelectInst &SI) { if (!isPointerType(SI.getType())) return; // Only pointer Selects - DSNodeHandle &Dest = ScalarMap[&SI]; + DSNodeHandle Dest = getValueDest(SI); Dest.mergeWith(getValueDest(*SI.getOperand(1))); Dest.mergeWith(getValueDest(*SI.getOperand(2))); } @@ -404,7 +406,7 @@ void GraphBuilder::visitSetCondInst(SetCondInst &SCI) { if (!isPointerType(SCI.getOperand(0)->getType()) || isa(SCI.getOperand(1))) return; // Only pointers - ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1))); + getValueDest(*SCI.getOperand(0)).mergeWith(getValueDest(*SCI.getOperand(1))); } @@ -1123,9 +1125,157 @@ N->setReadMarker(); return true; #ifdef LLVA_KERNEL + //TODO: + //state.c: + //llva_ipush_function0,1,3 llva_push_function1 llva_push_syscall + //llva_set_integer_stackp, llva_load_integer + //llva_load_stackp + //llva_load_invoke llva_save_invoke llva_icontext_save_retvalue + //llva_get_icontext_stackp llva_set_icontext_stackp + //llva_iset_privileged + } else if (F->getName() == "llva_icontext_save_retvalue") { + DSNodeHandle RetNH = getValueDest(**(CS.arg_begin())); + RetNH.getNode()->setModifiedMarker(); + return true; + } else if (F->getName() == "llva_icontext_load_retvalue" || + F->getName() == "llva_icontext_lif") { + DSNodeHandle RetNH = getValueDest(**(CS.arg_begin())); + RetNH.getNode()->setReadMarker(); + return true; + } else if (F->getName() == "llva_invokestrnlen") { + DSNodeHandle RetNH = getValueDest(**(CS.arg_begin())); + RetNH.getNode()->setReadMarker(); + return true; + } else if (F->getName() == "llva_unwind") { + DSNodeHandle RetNH = getValueDest(**(CS.arg_begin())); + RetNH.getNode()->setModifiedMarker(); + return true; + } else if (F->getName() == "llva_set_integer_stackp") { + DSNodeHandle RetNH = getValueDest(**(CS.arg_begin())); + RetNH.getNode()->setModifiedMarker(); + return true; + } else if (F->getName() == "llva_strcpy" || + F->getName() == "llva_strncpy" || + F->getName() == "llva_invokestrncpy") { + //This might be making unsafe assumptions about usage + //Merge return and first arg + DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); + RetNH.mergeWith(getValueDest(**CS.arg_begin())); + if (DSNode *N = RetNH.getNode()) + N->setHeapNodeMarker()->setModifiedMarker(); + //and read second pointer + if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) + N->setReadMarker(); + return true; + } else if (F->getName() == "pchk_drop_slab" || + F->getName() == "pchk_drop_obj" || + F->getName() == "pchk_drop_pool" || + F->getName() == "pchk_reg_obj" || + F->getName() == "pchk_reg_slab" || + F->getName() == "llva_assert_match_sig") { + return true; + } else if (F->getName() == "llva_save_fp" || + F->getName() == "llva_save_integer") { + DSNodeHandle Ptr = getValueDest(**CS.arg_begin()); + Ptr.getNode()->setModifiedMarker(); + return true; + } else if (F->getName() == "llva_load_fp" || + F->getName() == "llva_load_integer" || + F->getName() == "llva_get_eip") { + DSNodeHandle Ptr = getValueDest(**CS.arg_begin()); + Ptr.getNode()->setReadMarker(); + return true; + } else if (F->getName() == "llva_save_icontext") { + DSNodeHandle Ptr = getValueDest(**CS.arg_begin()); + Ptr.getNode()->setReadMarker(); + Ptr = getValueDest(**(CS.arg_begin() + 1)); + Ptr.getNode()->setModifiedMarker(); + return true; + } else if (F->getName() == "llva_load_icontext") { + DSNodeHandle Ptr = getValueDest(**CS.arg_begin()); + Ptr.getNode()->setModifiedMarker(); + Ptr = getValueDest(**(CS.arg_begin() + 1)); + Ptr.getNode()->setReadMarker(); + return true; + } else if (F->getName() == "llva_register_syscall" || + F->getName() == "llva_register_interrupt") { + //FIXME: track functions and clear Incomplete flags on them + // or set userspace flag on pointers + return true; + } else if (F->getName() == "llva_readiob" || + F->getName() == "llva_readioh" || + F->getName() == "llva_readiow") { + DSNodeHandle Ptr = getValueDest(**CS.arg_begin()); + if (Ptr.isNull()) Ptr = createNode(); + Ptr.getNode()->setReadMarker(); + Type* T; + if (F->getName() == "llva_readiob") T = Type::SByteTy; + if (F->getName() == "llva_readioh") T = Type::ShortTy; + if (F->getName() == "llva_readiow") T = Type::IntTy; + Ptr.getNode()->mergeTypeInfo(T, Ptr.getOffset(), false); + return true; + } else if (F->getName() == "llva_writeiob" || + F->getName() == "llva_writeioh" || + F->getName() == "llva_writeiow") { + DSNodeHandle Ptr = getValueDest(**CS.arg_begin()); + if (Ptr.isNull()) Ptr = createNode(); + Ptr.getNode()->setReadMarker(); + Type* T; + if (F->getName() == "llva_writeiob") T = Type::SByteTy; + if (F->getName() == "llva_writeioh") T = Type::ShortTy; + if (F->getName() == "llva_writeiow") T = Type::IntTy; + Ptr.getNode()->mergeTypeInfo(T, Ptr.getOffset(), false); + return true; + } else if (F->getName() == "llva_atomic_compare_and_swap" || + F->getName() == "llva_atomic_cas_lw" || + F->getName() == "llva_atomic_cas_h" || + F->getName() == "llva_atomic_cas_b" || + F->getName() == "llva_atomic_fetch_add_store" || + F->getName() == "llva_atomic_and" || + F->getName() == "llva_atomic_or") { + DSNodeHandle Ptr = getValueDest(**CS.arg_begin()); + if (Ptr.isNull()) Ptr = createNode(); + Ptr.getNode()->setReadMarker(); + Type* T = Type::IntTy; + if (F->getName() == "llva_atomic_cas_b") T = Type::SByteTy; + if (F->getName() == "llva_atomic_cas_h") T = Type::ShortTy; + Ptr.getNode()->mergeTypeInfo(T, Ptr.getOffset(), false); + return true; + } else if (F->getName() == "llva_save_tsc" || F->getName() == "llva_load_tsc") { + return true; + } else if (F->getName() == "llva_ialloca") { + DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); + RetNH.mergeWith(getValueDest(**CS.arg_begin())); + RetNH.getNode()->setModifiedMarker()->setReadMarker()->foldNodeCompletely(); + return true; + } else if (F->getName() == "llva_ipop_function0") { + // Mark the memory modified. + if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) + N->setModifiedMarker()->setReadMarker(); + return true; + } else if (F->getName() == "llva_init_icontext") { + DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); + RetNH.mergeWith(getValueDest(**(CS.arg_begin() + 1))); + RetNH.getNode()->setModifiedMarker()->foldNodeCompletely(); + if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) + N->setReadMarker(); + return true; + } else if (F->getName() == "llva_was_privileged") { + if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) + N->setReadMarker(); + return true; + } else if (F->getName() == "llva_clear_icontext") { + // Mark the memory modified. + if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) + N->setModifiedMarker(); + return true; + } else if (F->getName() == "llva_memset" || + F->getName() == "llva_invokememset") { + // Mark the memory modified. + if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) + N->setModifiedMarker(); + return true; } else if (F->getName() == "llva_memcpy") { - if (CS.getCaller()->getName() == "kmem_cache_alloc") - return false; // Merge the first & second arguments, and mark the memory read and // modified. DSNodeHandle RetNH = getValueDest(**CS.arg_begin()); @@ -1133,21 +1283,94 @@ if (DSNode *N = RetNH.getNode()) N->setModifiedMarker()->setReadMarker(); return true; -#if 1 - } else if (F->getName() == "llva_save_stackp") { - // Create a new DSNode for the memory returned by llva_save_stackp() - DSNode *N = createNode(); - N->setAllocaNodeMarker(); - N->setUnknownNodeMarker(); - CS.getInstruction()->dump(); - N->foldNodeCompletely(); + } else if (F->getName() == "llva_invokememcpy") { + //Find types + const Type* T1 = CS.getInstruction()->getOperand(1)->getType(); + const Type* T2 = CS.getInstruction()->getOperand(2)->getType(); + if (CastInst* CI1 = dyn_cast(CS.getInstruction()->getOperand(1))) + T1 = CI1->getOperand(0)->getType(); + if (CastInst* CI2 = dyn_cast(CS.getInstruction()->getOperand(2))) + T2 = CI2->getOperand(0)->getType(); + if (const PointerType* P1 = dyn_cast(T1)) + T1 = P1->getElementType(); + if (const PointerType* P2 = dyn_cast(T2)) + T2 = P2->getElementType(); + + uint64_t len = 0; + if (ConstantInt* CI = dyn_cast(CS.getInstruction()->getOperand(3))) + len = CI->getZExtValue(); + + DSNodeHandle NH1 = getValueDest(**CS.arg_begin()); + DSNodeHandle NH2 = getValueDest(**(CS.arg_begin()+1)); + + const TargetData &TD = NH1.getNode()->getTargetData(); + const Type* TTU = T1; + bool isArray = false; + if (isa(T1) && TD.getTypeSize(T1) >= TD.getTypeSize(T2)) + TTU = T1; + else if (isa(T2)) + TTU = T2; + else + isArray = true; + + if (TD.getTypeSize(TTU) < len) + isArray = true; + + if (NH1.getNode()->getType() == Type::VoidTy) + NH1.getNode()->mergeTypeInfo(TTU, NH1.getOffset(), false); + if (NH2.getNode()->getType() == Type::VoidTy) + NH2.getNode()->mergeTypeInfo(TTU, NH2.getOffset(), false); + + if (isArray) { + NH1.getNode()->setArrayMarker(); + NH2.getNode()->setArrayMarker(); + } - // - // TODO: - // For now, don't worry about creating a meta-pool. Stack locations - // are ignored by our analysis. - // + NH1.getNode()->mergeTypeInfo(TTU, NH1.getOffset(), false); + NH2.getNode()->mergeTypeInfo(TTU, NH2.getOffset(), false); + + NH1.getNode()->setModifiedMarker(); + NH2.getNode()->setReadMarker(); + + for (unsigned i = 0; i < len / 4; ++i) { + int x = NH1.getNode()->isArray() ? 0 : (NH1.getOffset() / 4 + i); + int y = NH2.getNode()->isArray() ? 0 : (NH2.getOffset() / 4 + i); + NH1.getNode()->getLink(x*4).mergeWith(NH2.getNode()->getLink(y*4)); + } +#if 0 + // Merge the first & second arguments, and mark the memory read and + // modified. + DSNodeHandle RetNH = getValueDest(**CS.arg_begin()); + RetNH.mergeWith(getValueDest(**(CS.arg_begin()+1))); + if (DSNode *N = RetNH.getNode()) + N->setModifiedMarker()->setReadMarker(); #endif + return true; + } else if (F->getName() == "llva_save_stackp" || + F->getName() == "llvm.returnaddress") { + // Create a new DSNode for the memory returned by llva_save_stackp() + DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); + RetNH.getNode()->setAllocaNodeMarker(); + RetNH.getNode()->setUnknownNodeMarker(); + RetNH.getNode()->foldNodeCompletely(); + return true; + } else if (F->getName() == "llva_get_icontext_stackp") { + // Create a new DSNode for the memory returned by llva_save_stackp() + DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); + RetNH.getNode()->setAllocaNodeMarker(); + RetNH.getNode()->setUnknownNodeMarker(); + RetNH.getNode()->foldNodeCompletely(); + if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) + N->setReadMarker(); + return true; + } else if (F->getName() == "llva_set_icontext_stackp") { + DSNodeHandle Dest = getValueDest(**CS.arg_begin()); + // Mark that the node is written to... + Dest.getNode()->setModifiedMarker(); + Dest.getNode()->foldNodeCompletely(); + getLink(Dest).mergeWith(getValueDest(**(CS.arg_begin() + 1))); + return true; + #if 0 } else if (F->getName() == "__generic_copy_from_user") { if (CS.getCaller()->getName() == "kmem_cache_alloc") @@ -1168,34 +1391,39 @@ void GraphBuilder::visitCallSite(CallSite CS) { Value *Callee = CS.getCalledValue(); + bool isSyscall6 = false; if (Function *F = dyn_cast(Callee)) { - if (F->isExternal()) - if (F->isIntrinsic() && visitIntrinsic(CS, F)) - return; - else { - // Determine if the called function is one of the specified heap - // allocation functions - if (AllocList.end() != std::find(AllocList.begin(), AllocList.end(), F->getName())) { - DSNode* N = createNode()->setHeapNodeMarker()->setModifiedMarker(); - setDestTo(*CS.getInstruction(), N); - N->getMP()->addCallSite(CS); - return; - } + // Determine if the called function is one of the specified heap + // allocation functions + if (AllocList.end() != std::find(AllocList.begin(), AllocList.end(), F->getName())) { + DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); + RetNH.getNode()->setHeapNodeMarker()->setModifiedMarker(); + RetNH.getNode()->getMP()->addCallSite(CS); + return; + } + + // Determine if the called function is one of the specified heap + // free functions + if (FreeList.end() != std::find(FreeList.begin(), FreeList.end(), + F->getName())) { + // Mark that the node is written to... + if (DSNode *N = getValueDest(*(CS.getArgument(0))).getNode()) + N->setModifiedMarker()->setHeapNodeMarker(); + return; + } - // Determine if the called function is one of the specified heap - // free functions - if (FreeList.end() != std::find(FreeList.begin(), FreeList.end(), - F->getName())) { - // Mark that the node is written to... - if (DSNode *N = getValueDest(*(CS.getArgument(0))).getNode()) - N->setModifiedMarker()->setHeapNodeMarker(); - return; - } + if (F->getName() == "llva_syscall6") + isSyscall6 = true; - if (visitExternal(CS,F)) - return; + if (F->isExternal()) { + if (F->isIntrinsic() && visitIntrinsic(CS, F)) + return; + + if (visitExternal(CS,F)) + return; + if (!isSyscall6) { // Unknown function, warn if it returns a pointer type or takes a // pointer argument. bool Warn = isPointerType(CS.getInstruction()->getType()); @@ -1207,10 +1435,16 @@ break; } if (Warn) { - DEBUG(std::cerr << "WARNING: Call to unknown external function '" - << F->getName() << "' will cause pessimistic results!\n"); + std::cerr << "WARNING: Call to unknown external function '" + << F->getName() << "' will cause pessimistic results!\n"; } } + } + } + + if (isSyscall6) { + assert (syscalls[CS.getArgument(0)] && "No registered syscall by that number"); + Callee = syscalls[CS.getArgument(0)]; } // Set up the return value... @@ -1230,7 +1464,7 @@ std::vector Args; Args.reserve(CS.arg_end()-CS.arg_begin()); - + // Calculate the arguments vector... for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) if (isPointerType((*I)->getType())) @@ -1432,8 +1666,24 @@ AllocList.push_back("kmalloc"); AllocList.push_back("__vmalloc"); AllocList.push_back("kmem_cache_alloc"); + AllocList.push_back("__alloc_bootmem"); FreeList.push_back("kfree"); FreeList.push_back("vfree"); + + //figure out all system call numbers + Function* lrs = M.getNamedFunction("llva_register_syscall"); + if (lrs) + for (Value::use_iterator ii = lrs->use_begin(), ee = lrs->use_end(); ii != ee; ++ii) + if (CallInst* CI = dyn_cast(*ii)) + if (CI->getCalledFunction() == lrs) { + Value* num = CI->getOperand(1); + Value* fun = CI->getOperand(2); + if (ConstantExpr* CE = dyn_cast(fun)) + if (CE->getOpcode() == Instruction::Cast) + fun = CE->getOperand(0); + if (Function* F = dyn_cast(fun)) + syscalls[num] = F; + } #endif const TargetData &TD = getAnalysis(); From clattner at apple.com Wed Jul 11 11:18:52 2007 From: clattner at apple.com (Chris Lattner) Date: Wed, 11 Jul 2007 09:18:52 -0700 Subject: [llvm-commits] PATCH: regarding PR1546 In-Reply-To: <4694CEC8.906@mac.com> References: <4694CEC8.906@mac.com> Message-ID: <83AFD2C3-957D-48ED-8B89-546DED8062D6@apple.com> On Jul 11, 2007, at 5:36 AM, Gabor Greif wrote: > I do not consider PR1546 closed just yet. > What I mentioned in the PR was only two of > ca. 140 Solaris failures. Hrm, this is very strange. Is this on solaris/sparc? If so, the sparc target should autodetect that and override msil and C. What target triple are you using? -Chris > Most of them complain that llc cannot choose between C and > MSIL output formats. > > The below prototypical patch corrects this type of failure. > > Is this the right way of handling it? > > Why does llc only fail on Solaris and not on Darwin? > > After I understood this problem I am happy to commit these 100+ files. > > Cheers, > > Gabor > > > Index: /home/ggreif/llvm/test/CodeGen/Generic/2005-07-12-memcpy-i64- > length.ll > =================================================================== > --- /home/ggreif/llvm/test/CodeGen/Generic/2005-07-12-memcpy-i64- > length.ll (revision 38488) > +++ /home/ggreif/llvm/test/CodeGen/Generic/2005-07-12-memcpy-i64- > length.ll (working copy) > @@ -1,4 +1,4 @@ > -; RUN: llvm-upgrade < %s | llvm-as | llc > +; RUN: llvm-upgrade < %s | llvm-as | llc -march=c > ; Test that llvm.memcpy works with a i64 length operand on all > targets. > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Wed Jul 11 11:32:11 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Jul 2007 16:32:11 -0000 Subject: [llvm-commits] [llvm] r39142 - /llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Message-ID: <200707111632.l6BGWBS5025145@zion.cs.uiuc.edu> Author: lattner Date: Wed Jul 11 11:32:10 2007 New Revision: 39142 URL: http://llvm.org/viewvc/llvm-project?rev=39142&view=rev Log: Fix an oversight: for modules with no other identifying target info, the sparc backend should be preferred when running on sparcs. Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp?rev=39142&r1=39141&r2=39142&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Wed Jul 11 11:32:10 2007 @@ -54,7 +54,11 @@ M.getPointerSize() != Module::AnyPointerSize) return 0; // Match for some other target +#if defined(__sparc__) + return 10; +#else return 0; +#endif } bool SparcTargetMachine::addInstSelector(FunctionPassManager &PM, bool Fast) { From greened at obbligato.org Wed Jul 11 11:37:06 2007 From: greened at obbligato.org (David A. Greene) Date: Wed, 11 Jul 2007 11:37:06 -0500 Subject: [llvm-commits] [llvm] r38517 - in /llvm/trunk: include/llvm/LinkAllPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/FastDSE.cpp In-Reply-To: <200707110046.l6B0kIWe023024@zion.cs.uiuc.edu> References: <200707110046.l6B0kIWe023024@zion.cs.uiuc.edu> Message-ID: <200707111137.06830.greened@obbligato.org> On Tuesday 10 July 2007 19:46, Owen Anderson wrote: > Author: resistor > Date: Tue Jul 10 19:46:18 2007 > New Revision: 38517 > > URL: http://llvm.org/viewvc/llvm-project?rev=38517&view=rev > Log: > Add FastDSE, a new algorithm for doing dead store elimination. This > algorithm is not as accurate as the current DSE, but it only a linear scan > over each block, rather than quadratic. Eventually (once it has been > improved somewhat), this will replace the current DSE. I hope by "replace" you mean, "will become the new default." Some of us are very interested in squeezing out every last possible bit of performance and are willing to take a compile time hit to do it. I don't want to lose the current DSE implementation. -Dave From baldrick at free.fr Wed Jul 11 11:59:21 2007 From: baldrick at free.fr (Duncan Sands) Date: Wed, 11 Jul 2007 16:59:21 -0000 Subject: [llvm-commits] [llvm] r39732 - /llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Message-ID: <200707111659.l6BGxL7s032265@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 11 11:59:20 2007 New Revision: 39732 URL: http://llvm.org/viewvc/llvm-project?rev=39732&view=rev Log: Exception handling has been implemented. Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=39732&r1=39731&r2=39732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Jul 11 11:59:20 2007 @@ -43,11 +43,10 @@ // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); - - // FIXME: Implement the invoke/unwind instructions! + if (!ExceptionHandling) PM.add(createLowerInvokePass(getTargetLowering())); - + // Make sure that no unreachable blocks are instruction selected. PM.add(createUnreachableBlockEliminationPass()); From lauro.venancio at gmail.com Wed Jul 11 12:19:51 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 11 Jul 2007 17:19:51 -0000 Subject: [llvm-commits] [llvm] r39737 - in /llvm/trunk/lib/Target: Alpha/AlphaISelLowering.cpp IA64/IA64ISelLowering.cpp Mips/MipsISelLowering.cpp Mips/MipsISelLowering.h PowerPC/PPCISelLowering.cpp Sparc/SparcISelDAGToDAG.cpp Message-ID: <200707111719.l6BHJpHf001031@zion.cs.uiuc.edu> Author: laurov Date: Wed Jul 11 12:19:51 2007 New Revision: 39737 URL: http://llvm.org/viewvc/llvm-project?rev=39737&view=rev Log: Assert when TLS is not implemented. Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.h llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=39737&r1=39736&r2=39737&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Wed Jul 11 12:19:51 2007 @@ -122,6 +122,7 @@ 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); @@ -424,6 +425,8 @@ 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(Op); GlobalValue *GV = GSDN->getGlobal(); Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp?rev=39737&r1=39736&r2=39737&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp Wed Jul 11 12:19:51 2007 @@ -108,6 +108,9 @@ 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.. @@ -538,6 +541,8 @@ 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; Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=39737&r1=39736&r2=39737&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Wed Jul 11 12:19:51 2007 @@ -59,6 +59,7 @@ // Custom setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); + setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom); setOperationAction(ISD::RET, MVT::Other, Custom); // Load extented operations for i1 types must be promoted @@ -115,6 +116,7 @@ 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::RETURNADDR: return LowerRETURNADDR(Op, DAG); } return SDOperand(); @@ -163,6 +165,12 @@ } SDOperand MipsTargetLowering:: +LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) +{ + assert(0 && "TLS not implemented for MIPS."); +} + +SDOperand MipsTargetLowering:: LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG) { // Depths > 0 not supported yet! if (cast(Op.getOperand(0))->getValue() > 0) Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=39737&r1=39736&r2=39737&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Wed Jul 11 12:19:51 2007 @@ -75,6 +75,7 @@ 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 LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG); }; Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=39737&r1=39736&r2=39737&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Jul 11 12:19:51 2007 @@ -159,9 +159,11 @@ // 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); @@ -1014,6 +1016,10 @@ return Lo; } +static SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) { + assert(0 && "TLS not implemented for PPC."); +} + static SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) { MVT::ValueType PtrVT = Op.getValueType(); GlobalAddressSDNode *GSDN = cast(Op); @@ -2862,6 +2868,7 @@ 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: Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=39737&r1=39736&r2=39737&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Wed Jul 11 12:19:51 2007 @@ -141,6 +141,7 @@ // 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 @@ -700,6 +701,8 @@ 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 Sparc."); case ISD::GlobalAddress: { GlobalValue *GV = cast(Op)->getGlobal(); SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i32); From clattner at apple.com Wed Jul 11 12:27:27 2007 From: clattner at apple.com (clattner at apple.com) Date: Wed, 11 Jul 2007 10:27:27 -0700 (PDT) Subject: [llvm-commits] [129262] A function that only has cleanups (destructors) to run when an exception is raised Message-ID: <20070711172727.50CB3DC17BC0@src> Revision: 129262 Author: clattner Date: 2007-07-11 10:27:26 -0700 (Wed, 11 Jul 2007) Log Message: ----------- A function that only has cleanups (destructors) to run when an exception is raised currently is not assigned a personality function because we don't bother creating a call to eh.selector if there are no catches. But the personality function is still needed, since it is the personality function that analyses the exception table and decides where to jump to (to the cleanups in this case). This patch causes a call to eh.selector to be generated in every landing pad, even if it has no type infos, because that specifies the personality function. Patch from Duncan Sands. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-07-10 17:46:46 UTC (rev 129261) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-07-11 17:27:26 UTC (rev 129262) @@ -2009,6 +2009,11 @@ // Fetch and store the exception selector. std::vector Args; + // The exception and the personality function. + Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr")); + Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality, + PointerType::get(Type::Int8Ty))); + for (std::vector::reverse_iterator I = CurrentEHScopes.rbegin(), E = CurrentEHScopes.rend(); I != E; ++I) { if (TREE_CODE(I->TryExpr) == TRY_CATCH_EXPR) { @@ -2022,16 +2027,6 @@ EH_FILTER_EXPR) ? FilterExpr : CatchList; } - if (I->InfosType == CatchList && !I->TypeInfos.size()) - continue; - - // Lazily add the exception and the personality function. - if (!Args.size()) { - Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr")); - Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality, - PointerType::get(Type::Int8Ty))); - } - if (I->InfosType == FilterExpr) // Filter - note the size. Args.push_back(ConstantInt::get(Type::Int32Ty, I->TypeInfos.size())); @@ -2042,11 +2037,9 @@ } } - if (Args.size()) { - Value *Select = Builder.CreateCall(FuncEHSelector, &Args[0], Args.size(), - "eh_select"); - Builder.CreateStore(Select, ExceptionSelectorValue); - } + Value *Select = Builder.CreateCall(FuncEHSelector, &Args[0], Args.size(), + "eh_select"); + Builder.CreateStore(Select, ExceptionSelectorValue); } From evan.cheng at apple.com Wed Jul 11 13:26:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 11 Jul 2007 18:26:41 -0000 Subject: [llvm-commits] [test-suite] r39742 - /test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c Message-ID: <200707111826.l6BIQfRU003514@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jul 11 13:26:40 2007 New Revision: 39742 URL: http://llvm.org/viewvc/llvm-project?rev=39742&view=rev Log: Temporarily disable TimberWolfMC. llc is hanging when compiling it for some targets. Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c?rev=39742&r1=39741&r2=39742&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c Wed Jul 11 13:26:40 2007 @@ -1,4 +1,7 @@ #include "custom.h" +#ifdef __arm__ +#error "Temporarily disabled!" +#endif double spot_control ; int spotPenalty ; int spotXhash ; From dalej at apple.com Wed Jul 11 13:32:38 2007 From: dalej at apple.com (Dale Johannesen) Date: Wed, 11 Jul 2007 18:32:38 -0000 Subject: [llvm-commits] [llvm] r39743 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200707111832.l6BIWcmr003664@zion.cs.uiuc.edu> Author: johannes Date: Wed Jul 11 13:32:38 2007 New Revision: 39743 URL: http://llvm.org/viewvc/llvm-project?rev=39743&view=rev Log: Fix hang compiling TimberWolf (allow for islands of size other than 4). Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=39743&r1=39742&r2=39743&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jul 11 13:32:38 2007 @@ -161,7 +161,7 @@ MachineInstr *CPEMI, unsigned Disp, bool DoDump); bool WaterIsInRange(unsigned UserOffset, MachineBasicBlock *Water, - unsigned Disp); + CPUser &U); bool OffsetIsInRange(unsigned UserOffset, unsigned TrialOffset, unsigned Disp, bool NegativeOK); bool BBIsInRange(MachineInstr *MI, MachineBasicBlock *BB, unsigned Disp); @@ -199,8 +199,8 @@ /// 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"; + DOUT << "block " << J << " offset " << BBOffsets[J] << + " size " << BBSizes[J] << "\n"; } } @@ -668,8 +668,9 @@ /// Water (a basic block) will be in range for the specific MI. bool ARMConstantIslands::WaterIsInRange(unsigned UserOffset, - MachineBasicBlock* Water, unsigned MaxDisp) + MachineBasicBlock* Water, CPUser &U) { + unsigned MaxDisp = U.MaxDisp; MachineFunction::iterator I = next(MachineFunction::iterator(Water)); unsigned CPEOffset = BBOffsets[Water->getNumber()] + BBSizes[Water->getNumber()]; @@ -678,7 +679,7 @@ // the offset of the instruction. (Currently applies only to ARM, so // no alignment compensation attempted here.) if (CPEOffset < UserOffset) - UserOffset += 4; + UserOffset += U.CPEMI->getOperand(2).getImm(); return OffsetIsInRange (UserOffset, CPEOffset, MaxDisp, !isThumb); } @@ -869,7 +870,7 @@ for (std::vector::iterator IP = prior(WaterList.end()), B = WaterList.begin();; --IP) { MachineBasicBlock* WaterBB = *IP; - if (WaterIsInRange(UserOffset, WaterBB, U.MaxDisp)) { + if (WaterIsInRange(UserOffset, WaterBB, U)) { if (isThumb && (BBOffsets[WaterBB->getNumber()] + BBSizes[WaterBB->getNumber()])%4 != 0) { From tonic at nondot.org Wed Jul 11 13:41:34 2007 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 11 Jul 2007 18:41:34 -0000 Subject: [llvm-commits] [llvm] r39744 - in /llvm/trunk: include/llvm/Transforms/Utils/Local.h lib/Transforms/Utils/DemoteRegToStack.cpp Message-ID: <200707111841.l6BIfY0P003933@zion.cs.uiuc.edu> Author: tbrethou Date: Wed Jul 11 13:41:34 2007 New Revision: 39744 URL: http://llvm.org/viewvc/llvm-project?rev=39744&view=rev Log: Adding ability to demote phi to stack. Modified: llvm/trunk/include/llvm/Transforms/Utils/Local.h llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp Modified: llvm/trunk/include/llvm/Transforms/Utils/Local.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Local.h?rev=39744&r1=39743&r2=39744&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/Local.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/Local.h Wed Jul 11 13:41:34 2007 @@ -80,6 +80,11 @@ /// AllocaInst *DemoteRegToStack(Instruction &X, bool VolatileLoads = false); +/// 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); + } // End llvm namespace #endif Modified: llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp?rev=39744&r1=39743&r2=39744&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp Wed Jul 11 13:41:34 2007 @@ -93,3 +93,41 @@ 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) { + if (P->use_empty()) { + P->eraseFromParent(); + return 0; + } + + // Create a stack slot to hold the value. + Function *F = P->getParent()->getParent(); + AllocaInst *Slot = new AllocaInst(P->getType(), 0, P->getName(), + 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(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(InsertPt); ++InsertPt); + Value *V = new LoadInst(Slot, P->getName()+".reload", P); + P->replaceAllUsesWith(V); + + // Delete phi. + P->eraseFromParent(); + + return Slot; +} From clattner at apple.com Wed Jul 11 13:43:44 2007 From: clattner at apple.com (Chris Lattner) Date: Wed, 11 Jul 2007 11:43:44 -0700 Subject: [llvm-commits] [llvm] r38517 - in /llvm/trunk: include/llvm/LinkAllPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/FastDSE.cpp In-Reply-To: <200707111137.06830.greened@obbligato.org> References: <200707110046.l6B0kIWe023024@zion.cs.uiuc.edu> <200707111137.06830.greened@obbligato.org> Message-ID: <9815A0BE-95A4-492E-9912-D88244170C28@apple.com> On Jul 11, 2007, at 9:37 AM, David A. Greene wrote: > On Tuesday 10 July 2007 19:46, Owen Anderson wrote: >> Author: resistor >> Date: Tue Jul 10 19:46:18 2007 >> New Revision: 38517 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=38517&view=rev >> Log: >> Add FastDSE, a new algorithm for doing dead store elimination. This >> algorithm is not as accurate as the current DSE, but it only a >> linear scan >> over each block, rather than quadratic. Eventually (once it has been >> improved somewhat), this will replace the current DSE. > > I hope by "replace" you mean, "will become the new default." Some > of us > are very interested in squeezing out every last possible bit of > performance > and are willing to take a compile time hit to do it. I don't want > to lose the > current DSE implementation. Right now, the current DSE pass does *very* little, and is extremely expensive. The new FastDSE current misses some cases that the existing DSE pass gets, but Owen is working on completing it. Once done, I'd be very surprised if DSE caught any cases that FastDSE doesn't. If that's the case, we should be able to nuke the old DSE pass. If it's not the case, we'll keep it. -Chris From evan.cheng at apple.com Wed Jul 11 13:46:05 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 11 Jul 2007 18:46:05 -0000 Subject: [llvm-commits] [test-suite] r39745 - /test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c Message-ID: <200707111846.l6BIk5LE004077@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jul 11 13:46:05 2007 New Revision: 39745 URL: http://llvm.org/viewvc/llvm-project?rev=39745&view=rev Log: Now fixed! Thx Dale. Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c?rev=39745&r1=39744&r2=39745&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/main.c Wed Jul 11 13:46:05 2007 @@ -1,7 +1,4 @@ #include "custom.h" -#ifdef __arm__ -#error "Temporarily disabled!" -#endif double spot_control ; int spotPenalty ; int spotXhash ; From resistor at mac.com Wed Jul 11 14:03:09 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 11 Jul 2007 19:03:09 -0000 Subject: [llvm-commits] [llvm] r39747 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707111903.l6BJ39WO004746@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 11 14:03:09 2007 New Revision: 39747 URL: http://llvm.org/viewvc/llvm-project?rev=39747&view=rev Log: Clean up a few things based on Chris' feedback. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39747&r1=39746&r2=39747&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Wed Jul 11 14:03:09 2007 @@ -2,7 +2,7 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under +// This file was developed by Owen Anderson and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// @@ -64,7 +64,9 @@ bool FDSE::runOnBasicBlock(BasicBlock &BB) { MemoryDependenceAnalysis& MD = getAnalysis(); + // Record the last-seen store to this pointer DenseMap lastStore; + // Record instructions possibly made dead by deleting a store SetVector possiblyDead; bool MadeChange = false; @@ -73,10 +75,10 @@ for (BasicBlock::iterator BBI = BB.begin(), BBE = BB.end(); BBI != BBE; ++BBI) { // If we find a store... if (StoreInst* S = dyn_cast(BBI)) { + StoreInst*& last = lastStore[S->getPointerOperand()]; // ... to a pointer that has been stored to before... - if (lastStore.count(S->getPointerOperand())) { - StoreInst* last = lastStore[S->getPointerOperand()]; + if (last) { // ... and no other memory dependencies are between them.... if (MD.getDependency(S) == last) { @@ -94,7 +96,7 @@ } // Update our most-recent-store map - lastStore.insert(std::make_pair(S->getPointerOperand(), S)); + last = S; } } @@ -120,8 +122,10 @@ // 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 (Instruction *Op = dyn_cast(I->getOperand(i))) - DeadInsts.insert(Op); // Attempt to nuke it later. + if (I->getOperand(i)->hasOneUse()) + if (Instruction* Op = dyn_cast(I->getOperand(i))) + DeadInsts.insert(Op); // Attempt to nuke it later. + I->setOperand(i, 0); // Drop from the operand list. } From evan.cheng at apple.com Wed Jul 11 14:17:18 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 11 Jul 2007 19:17:18 -0000 Subject: [llvm-commits] [llvm] r39748 - /llvm/trunk/lib/CodeGen/VirtRegMap.cpp Message-ID: <200707111917.l6BJHIeI005147@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jul 11 14:17:18 2007 New Revision: 39748 URL: http://llvm.org/viewvc/llvm-project?rev=39748&view=rev Log: Missed a couple of places where new instructions are added due to spill / restore. Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=39748&r1=39747&r2=39748&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Wed Jul 11 14:17:18 2007 @@ -426,6 +426,63 @@ +/// 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 &KillOps) { + for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { + MachineOperand &MO = MI.getOperand(i); + if (!MO.isReg() || !MO.isUse() || !MO.isKill()) + continue; + unsigned Reg = MO.getReg(); + if (KillOps[Reg] == &MO) { + RegKills.reset(Reg); + KillOps[Reg] = NULL; + } + } +} + +/// 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 &KillOps) { + const TargetInstrDescriptor *TID = MI.getInstrDescriptor(); + for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { + MachineOperand &MO = MI.getOperand(i); + if (!MO.isReg() || !MO.isUse()) + continue; + unsigned Reg = MO.getReg(); + if (Reg == 0) + continue; + + if (RegKills[Reg]) { + // That can't be right. Register is killed but not re-defined and it's + // being reused. Let's fix that. + KillOps[Reg]->unsetIsKill(); + if (i < TID->numOperands && + 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.isReg() || !MO.isDef()) + continue; + unsigned Reg = MO.getReg(); + RegKills.reset(Reg); + KillOps[Reg] = NULL; + } +} + + // 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 { @@ -494,7 +551,9 @@ unsigned GetRegForReload(unsigned PhysReg, MachineInstr *MI, AvailableSpills &Spills, std::map &MaybeDeadStores, - SmallSet &Rejected) { + SmallSet &Rejected, + BitVector &RegKills, + std::vector &KillOps) { if (Reuses.empty()) return PhysReg; // This is most often empty. for (unsigned ro = 0, e = Reuses.size(); ro != e; ++ro) { @@ -509,7 +568,8 @@ // 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); + return GetRegForReload(NewReg, MI, Spills, MaybeDeadStores, Rejected, + RegKills, KillOps); } else { // Otherwise, we might also have a problem if a previously reused // value aliases the new register. If so, codegen the previous reload @@ -534,7 +594,8 @@ // 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); + MI, Spills, MaybeDeadStores, + Rejected, RegKills, KillOps); MRI->loadRegFromStackSlot(*MBB, MI, NewPhysReg, NewOp.StackSlot, AliasRC); @@ -548,8 +609,10 @@ Spills.addAvailable(NewOp.StackSlot, MI, NewPhysReg); ++NumLoads; - DEBUG(MachineBasicBlock::iterator MII = MI; - DOUT << '\t' << *prior(MII)); + MachineBasicBlock::iterator MII = MI; + --MII; + UpdateKills(*MII, RegKills, KillOps); + DOUT << '\t' << *MII; DOUT << "Reuse undone!\n"; --NumReused; @@ -575,71 +638,17 @@ /// sees r1 is taken by t2, tries t2's reload register r0 ... unsigned GetRegForReload(unsigned PhysReg, MachineInstr *MI, AvailableSpills &Spills, - std::map &MaybeDeadStores) { + std::map &MaybeDeadStores, + BitVector &RegKills, + std::vector &KillOps) { SmallSet Rejected; - return GetRegForReload(PhysReg, MI, Spills, MaybeDeadStores, Rejected); + return GetRegForReload(PhysReg, MI, Spills, MaybeDeadStores, Rejected, + RegKills, KillOps); } }; } -/// 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 &KillOps) { - for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { - MachineOperand &MO = MI.getOperand(i); - if (!MO.isReg() || !MO.isUse() || !MO.isKill()) - continue; - unsigned Reg = MO.getReg(); - if (KillOps[Reg] == &MO) { - RegKills.reset(Reg); - KillOps[Reg] = NULL; - } - } -} - -/// 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 &KillOps) { - const TargetInstrDescriptor *TID = MI.getInstrDescriptor(); - for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { - MachineOperand &MO = MI.getOperand(i); - if (!MO.isReg() || !MO.isUse()) - continue; - unsigned Reg = MO.getReg(); - if (Reg == 0) - continue; - - if (RegKills[Reg]) { - // That can't be right. Register is killed but not re-defined and it's - // being reused. Let's fix that. - KillOps[Reg]->unsetIsKill(); - if (i < TID->numOperands && - 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.isReg() || !MO.isDef()) - continue; - unsigned Reg = MO.getReg(); - RegKills.reset(Reg); - KillOps[Reg] = NULL; - } -} - - /// rewriteMBB - Keep track of which spills are available even after the /// register allocator is done with them. If possible, avoid reloading vregs. void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM, @@ -820,7 +829,7 @@ // reuser. if (ReusedOperands.hasReuses()) DesignatedReg = ReusedOperands.GetRegForReload(DesignatedReg, &MI, - Spills, MaybeDeadStores); + Spills, MaybeDeadStores, RegKills, KillOps); // If the mapped designated register is actually the physreg we have // incoming, we don't need to inserted a dead copy. @@ -868,7 +877,7 @@ // reuser. if (ReusedOperands.hasReuses()) PhysReg = ReusedOperands.GetRegForReload(PhysReg, &MI, - Spills, MaybeDeadStores); + Spills, MaybeDeadStores, RegKills, KillOps); MF.setPhysRegUsed(PhysReg); ReusedOperands.markClobbered(PhysReg); @@ -1044,7 +1053,7 @@ // 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); + Spills, MaybeDeadStores, RegKills, KillOps); } } @@ -1083,6 +1092,7 @@ MBB.erase(&MI); Erased = true; VRM.RemoveFromFoldedVirtMap(&MI); + UpdateKills(*LastStore, RegKills, KillOps); goto ProcessNextInst; } } From evan.cheng at apple.com Wed Jul 11 14:29:05 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 11 Jul 2007 19:29:05 -0000 Subject: [llvm-commits] [llvm] r39749 - /llvm/trunk/test/CodeGen/X86/2007-07-10-StackerAssert.ll Message-ID: <200707111929.l6BJT5MF005600@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jul 11 14:29:05 2007 New Revision: 39749 URL: http://llvm.org/viewvc/llvm-project?rev=39749&view=rev Log: Add test case for PR1545. Added: llvm/trunk/test/CodeGen/X86/2007-07-10-StackerAssert.ll Added: llvm/trunk/test/CodeGen/X86/2007-07-10-StackerAssert.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-07-10-StackerAssert.ll?rev=39749&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-07-10-StackerAssert.ll (added) +++ llvm/trunk/test/CodeGen/X86/2007-07-10-StackerAssert.ll Wed Jul 11 14:29:05 2007 @@ -0,0 +1,41 @@ +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -mcpu=athlon -relocation-model=pic +; PR1545 + + at .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 ; [#uses=2] + br i1 false, label %cond_true425, label %cond_next443 + +cond_true425: ; preds = %bb383 + %tmp430 = load float* null ; [#uses=1] + %tmp432 = sub float %tmp430, %tmp408 ; [#uses=1] + %tmp432433 = fpext float %tmp432 to double ; [#uses=1] + %tmp434435 = fpext float %tmp408 to 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 +} From asl at math.spbu.ru Wed Jul 11 14:51:06 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 11 Jul 2007 19:51:06 -0000 Subject: [llvm-commits] [llvm] r39751 - /llvm/trunk/tools/llvm2cpp/CppWriter.cpp Message-ID: <200707111951.l6BJp6e7006219@zion.cs.uiuc.edu> Author: asl Date: Wed Jul 11 14:51:06 2007 New Revision: 39751 URL: http://llvm.org/viewvc/llvm-project?rev=39751&view=rev Log: Emit correct linkage. Patch by Roman Samoilov. Modified: llvm/trunk/tools/llvm2cpp/CppWriter.cpp Modified: llvm/trunk/tools/llvm2cpp/CppWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm2cpp/CppWriter.cpp?rev=39751&r1=39750&r2=39751&view=diff ============================================================================== --- llvm/trunk/tools/llvm2cpp/CppWriter.cpp (original) +++ llvm/trunk/tools/llvm2cpp/CppWriter.cpp Wed Jul 11 14:51:06 2007 @@ -280,9 +280,9 @@ case GlobalValue::ExternalLinkage: Out << "GlobalValue::ExternalLinkage"; break; case GlobalValue::DLLImportLinkage: - Out << "GlobalValue::DllImportLinkage"; break; + Out << "GlobalValue::DLLImportLinkage"; break; case GlobalValue::DLLExportLinkage: - Out << "GlobalValue::DllExportLinkage"; break; + Out << "GlobalValue::DLLExportLinkage"; break; case GlobalValue::ExternalWeakLinkage: Out << "GlobalValue::ExternalWeakLinkage"; break; case GlobalValue::GhostLinkage: From lauro.venancio at gmail.com Wed Jul 11 14:56:53 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 11 Jul 2007 19:56:53 -0000 Subject: [llvm-commits] [llvm] r39752 - in /llvm/trunk: lib/Target/CBackend/CBackend.cpp test/CodeGen/CBackend/2007-07-11-PackedStruct.ll Message-ID: <200707111956.l6BJusN2006560@zion.cs.uiuc.edu> Author: laurov Date: Wed Jul 11 14:56:53 2007 New Revision: 39752 URL: http://llvm.org/viewvc/llvm-project?rev=39752&view=rev Log: Handle packed structs in the CBackend. Added: llvm/trunk/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=39752&r1=39751&r2=39752&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Wed Jul 11 14:56:53 2007 @@ -466,7 +466,10 @@ printType(Out, *I, false, "field" + utostr(Idx++)); Out << ";\n"; } - return Out << '}'; + Out << '}'; + if (STy->isPacked()) + Out << " __attribute__ ((packed))"; + return Out; } case Type::PointerTyID: { Added: llvm/trunk/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll?rev=39752&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll (added) +++ llvm/trunk/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll Wed Jul 11 14:56:53 2007 @@ -0,0 +1,9 @@ +; 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 +} From resistor at mac.com Wed Jul 11 15:38:34 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 11 Jul 2007 20:38:34 -0000 Subject: [llvm-commits] [llvm] r39753 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707112038.l6BKcYZO008386@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 11 15:38:34 2007 New Revision: 39753 URL: http://llvm.org/viewvc/llvm-project?rev=39753&view=rev Log: Handle eliminating stores that occur right before a free. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39753&r1=39752&r2=39753&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Wed Jul 11 15:38:34 2007 @@ -74,14 +74,22 @@ // 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... - if (StoreInst* S = dyn_cast(BBI)) { - StoreInst*& last = lastStore[S->getPointerOperand()]; + if (isa(BBI) || isa(BBI)) { + Value* pointer = 0; + if (StoreInst* S = dyn_cast(BBI)) + pointer = S->getPointerOperand(); + else if (FreeInst* F = dyn_cast(BBI)) + pointer = F->getPointerOperand(); + assert(pointer && "Not a free or a store?"); + + StoreInst*& last = lastStore[pointer]; // ... to a pointer that has been stored to before... if (last) { // ... and no other memory dependencies are between them.... - if (MD.getDependency(S) == last) { + if (MD.getDependency(BBI) == last) { + // Remove it! MD.removeInstruction(last); @@ -96,7 +104,10 @@ } // Update our most-recent-store map - last = S; + if (StoreInst* S = dyn_cast(BBI)) + last = S; + else + last = 0; } } From resistor at mac.com Wed Jul 11 16:06:57 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 11 Jul 2007 21:06:57 -0000 Subject: [llvm-commits] [llvm] r39754 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707112106.l6BL6vLD009570@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 11 16:06:56 2007 New Revision: 39754 URL: http://llvm.org/viewvc/llvm-project?rev=39754&view=rev Log: Add support for eliminate stores to stack-allocated memory locations at the end of a function. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39754&r1=39753&r2=39754&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Wed Jul 11 16:06:56 2007 @@ -73,7 +73,7 @@ // 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... + // If we find a store or a free... if (isa(BBI) || isa(BBI)) { Value* pointer = 0; if (StoreInst* S = dyn_cast(BBI)) @@ -111,6 +111,50 @@ } } + // 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) { + // Pointers alloca'd in this function are dead in the end block + SmallPtrSet 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(I)) + deadPointers.insert(AI); + + // Scan the basic block backwards + for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ){ + --BBI; + + if (deadPointers.empty()) + break; + + // If we find a store whose pointer is dead... + if (StoreInst* S = dyn_cast(BBI)) { + if (deadPointers.count(S->getPointerOperand())){ + // Remove it! + MD.removeInstruction(S); + + // DCE instructions only used to calculate that store + if (Instruction* D = dyn_cast(S->getOperand(0))) + possiblyDead.insert(D); + + BBI++; + S->eraseFromParent(); + NumFastStores++; + MadeChange = true; + } + + // If we encounter a use of the pointer, it is no longer considered dead + } else if (LoadInst* L = dyn_cast(BBI)) { + deadPointers.erase(L->getPointerOperand()); + } else if (VAArgInst* V = dyn_cast(BBI)) { + deadPointers.erase(V->getOperand(0)); + } + } + } + // Do a trivial DCE while (!possiblyDead.empty()) { Instruction *I = possiblyDead.back(); From clattner at apple.com Wed Jul 11 16:57:31 2007 From: clattner at apple.com (Chris Lattner) Date: Wed, 11 Jul 2007 14:57:31 -0700 Subject: [llvm-commits] [llvm] r39753 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp In-Reply-To: <200707112038.l6BKcYZO008386@zion.cs.uiuc.edu> References: <200707112038.l6BKcYZO008386@zion.cs.uiuc.edu> Message-ID: <0A4B6AAB-9306-419C-A526-F4562870196D@apple.com> On Jul 11, 2007, at 1:38 PM, Owen Anderson wrote: > Author: resistor > Date: Wed Jul 11 15:38:34 2007 > New Revision: 39753 > > URL: http://llvm.org/viewvc/llvm-project?rev=39753&view=rev > Log: > Handle eliminating stores that occur right before a free. Don't forget that "free" deallocates the whole object, not just the pointer passed in. This store should be nuked: int *P = ... P[1] = 0; free(P); -Chris > Modified: > llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp > > Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ > Scalar/FastDSE.cpp?rev=39753&r1=39752&r2=39753&view=diff > > ====================================================================== > ======== > --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) > +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Wed Jul 11 > 15:38:34 2007 > @@ -74,14 +74,22 @@ > // 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... > - if (StoreInst* S = dyn_cast(BBI)) { > - StoreInst*& last = lastStore[S->getPointerOperand()]; > + if (isa(BBI) || isa(BBI)) { > + Value* pointer = 0; > + if (StoreInst* S = dyn_cast(BBI)) > + pointer = S->getPointerOperand(); > + else if (FreeInst* F = dyn_cast(BBI)) > + pointer = F->getPointerOperand(); > + assert(pointer && "Not a free or a store?"); > + > + StoreInst*& last = lastStore[pointer]; > > // ... to a pointer that has been stored to before... > if (last) { > > // ... and no other memory dependencies are between them.... > - if (MD.getDependency(S) == last) { > + if (MD.getDependency(BBI) == last) { > + > // Remove it! > MD.removeInstruction(last); > > @@ -96,7 +104,10 @@ > } > > // Update our most-recent-store map > - last = S; > + if (StoreInst* S = dyn_cast(BBI)) > + last = S; > + else > + last = 0; > } > } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Wed Jul 11 17:08:46 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 11 Jul 2007 22:08:46 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39757 - /llvm-gcc-4-2/trunk/README.LLVM Message-ID: <200707112208.l6BM8kVU011853@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jul 11 17:08:46 2007 New Revision: 39757 URL: http://llvm.org/viewvc/llvm-project?rev=39757&view=rev Log: Copy README from llvm-gcc-4.0 Added: llvm-gcc-4-2/trunk/README.LLVM Added: llvm-gcc-4-2/trunk/README.LLVM URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/README.LLVM?rev=39757&view=auto ============================================================================== --- llvm-gcc-4-2/trunk/README.LLVM (added) +++ llvm-gcc-4-2/trunk/README.LLVM Wed Jul 11 17:08:46 2007 @@ -0,0 +1,148 @@ +//===----------------------------------------------------------------------===// +// Building llvm-gcc4 from Source +//===----------------------------------------------------------------------===// + +These instructions describe how to build llvm-gcc-4.2. + +Note that this should work on all the supported LLVM targets. If you run into +problems, please ask for help or file a bug. + +Please follow these instructions carefully. In particular, the target-specific +configure instructions should be followed to ensure correct builds. + + +//===----------------------------------------------------------------------===// + First Step: Build LLVM +//===----------------------------------------------------------------------===// + +First, check out LLVM from CVS, then build it in optimized mode (a Release +build, as opposed to a Debug one)): + + make ENABLE_OPTIMIZED=1 + +If you use a Debug instead of a Release build of LLVM, make sure you add +--enable-checking to the configure flags below or llvm-gcc-4.2 will not build! + +Below we assume the LLVM OBJDIR is $LLVMOBJDIR. + + +//===----------------------------------------------------------------------===// + Unpack Front-end Source +//===----------------------------------------------------------------------===// + +$ mkdir llvm-gcc +$ cd llvm-gcc +$ tar zxvf llvm-gcc4-x.y.source.tar.gz + + +//===----------------------------------------------------------------------===// + Target-Specific configure Instructions +//===----------------------------------------------------------------------===// + +//===----------------------- +Linux-specific Instructions: + +If llvm-gcc doesn't build right, try building LLVM with OPTIMIZE_OPTION=-O2. +This may be host compiler version specific. + +If you get an error message building llvm-gcc like this: + ...gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by + /usr/lib/libstdc++.so.6) + +you are probably hitting http://llvm.org/PR896. Please reconfigure with the +--disable-shared option to work around this. + +//===----------------------- +X86-64/AMD-64/EM64-T for any OS other than Darwin/Mac OS X: + +When targeting non-darwin X86-64/AMD-64/EM64-T, configure with +--disable-shared. The LLVM X86-64 backend doesn't support PIC codegen on +non-darwin systems yet. If you get a build error, try configuring with +--disable-multilib. + + +//===----------------------- +Darwin/Mac OS X Instructions: + +First step: Upgrade your Xcode installation: you need at least Xcode 2.4. + +Next, decide if you want Objective-C support. If so: + EXTRALANGS=,objc,obj-c++ + +If building for Darwin/PPC: + TRIPLE=powerpc-apple-darwin8 + +If building for Darwin/X86 (32- and 64-bit support): + TARGETOPTIONS=--with-arch=nocona --with-tune=generic + TRIPLE=i686-apple-darwin8 + +If building for Darwin/X86 (32-bit support only): + TARGETOPTIONS=--with-arch=pentium-m --with-tune=prescott --disable-multilib + TRIPLE=i686-apple-darwin8 + +Building for Darwin/Mac OS X is significantly different than building for other +targets. Darwin considers libstdc++ to be part of the operating system, not as +part of the compiler. As such, you should *remove* the libstdc++-v3 directory +from the llvm-gcc4 source directory before configuring it: + + rm -rf llvm-gcc4-x.y.source/libstdc++-v3 + +In addition, you *must* specify the following options to configure: + + --with-gxx-include-dir=/usr/include/c++/4.0.0 + --build=$TRIPLE --host=$TRIPLE --target=$TRIPLE + +With these options, llvm-gcc will build the same way as Apple's system GCC. + + +//===----------------------------------------------------------------------===// + Build Options +//===----------------------------------------------------------------------===// + +Version Identifier: + + If you want LLVM to include an identifying marker in the --version output, + build llvm-gcc with LLVM_VERSION_INFO=XXX. For example, to build the LLVM + 1.9 Release front-end, use 'make LLVM_VERSION_INFO=1.9'. This will cause the + front-end to print: "gcc (GCC) 4.0.1 LLVM (Apple Computer, Inc. build 1.9)" + as the version number. + + BUILDOPTIONS=LLVM_VERSION_INFO=whatever + + +//===----------------------------------------------------------------------===// + Configure, Build, Install, Test +//===----------------------------------------------------------------------===// + +Next, make an object directory and install directory as siblings to the +llvm-gcc source directory, and build and install llvm-gcc: + +$ mkdir obj +$ mkdir install +$ cd obj +$ ../llvm-gcc4-x.y.source/configure --prefix=`pwd`/../install \ + --enable-llvm=$LLVMOBJDIR --enable-languages=c,c++$EXTRALANGS $TARGETOPTIONS +$ make $BUILDOPTIONS +$ make install + +Note that if you prefer to bootstrap llvm-gcc (so that the final llvm-gcc +executables have been compiled with llvm-gcc itself), replace "make" with +"make bootstrap". + +Finally, add symlinks for llvm-gcc and llvm-g++ to your path: + +$ su +$ cd /usr/local/bin +$ ln -s /install/bin/gcc llvm-gcc +$ ln -s /install/bin/g++ llvm-g++ +$ exit + +You should now have something like: + +$ llvm-gcc -v +... +gcc version 4.0.1 LLVM (Apple Computer, Inc. build 5400) + + +** NOTE: If the -v line above doesn't include "LLVM", you probably mistyped the +--enable-llvm=xxx line and have a normal gcc, not an llvm-gcc. From bruno.cardoso at gmail.com Wed Jul 11 17:44:21 2007 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 11 Jul 2007 22:44:21 -0000 Subject: [llvm-commits] [llvm] r39758 - /llvm/trunk/lib/Target/Mips/MipsMachineFunction.h Message-ID: <200707112244.l6BMiLnN013121@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 11 17:44:21 2007 New Revision: 39758 URL: http://llvm.org/viewvc/llvm-project?rev=39758&view=rev Log: Added MipsMachineFunction class, to hold Mips dinamic stack info when inserting Prologue/Epilog Added: llvm/trunk/lib/Target/Mips/MipsMachineFunction.h Added: llvm/trunk/lib/Target/Mips/MipsMachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsMachineFunction.h?rev=39758&view=auto ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsMachineFunction.h (added) +++ llvm/trunk/lib/Target/Mips/MipsMachineFunction.h Wed Jul 11 17:44:21 2007 @@ -0,0 +1,54 @@ +//===-- MipsMachineFunctionInfo.h - Private data used for Mips ----*- C++ -*-=// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Bruno Cardoso Lopes and 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/CodeGen/MachineFunction.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; + +public: + MipsFunctionInfo(MachineFunction& MF) + : FPStackOffset(0), RAStackOffset(0) + {} + + int getFPStackOffset() const { return FPStackOffset; } + void setFPStackOffset(int Off) { FPStackOffset = Off; } + + int getRAStackOffset() const { return RAStackOffset; } + void setRAStackOffset(int Off) { RAStackOffset = Off; } + + int getTopSavedRegOffset() const { + return (RAStackOffset > FPStackOffset) ? + (RAStackOffset) : (FPStackOffset); + } +}; + +} // end of namespace llvm + + +#endif From bruno.cardoso at gmail.com Wed Jul 11 17:47:02 2007 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 11 Jul 2007 22:47:02 -0000 Subject: [llvm-commits] [llvm] r39759 - /llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Message-ID: <200707112247.l6BMl20w013182@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 11 17:47:02 2007 New Revision: 39759 URL: http://llvm.org/viewvc/llvm-project?rev=39759&view=rev Log: Removed unused immediate PatLeaf, fixed lui instruction Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=39759&r1=39758&r2=39759&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Wed Jul 11 17:47:02 2007 @@ -73,7 +73,7 @@ def immSExt16 : PatLeaf<(imm), [{ if (N->getValueType(0) == MVT::i32) return (int32_t)N->getValue() == (short)N->getValue(); - else + else return (int64_t)N->getValue() == (short)N->getValue(); }]>; @@ -82,17 +82,12 @@ // immediate are caught. // e.g. addiu, sltiu def immZExt16 : PatLeaf<(imm), [{ - return (uint64_t)N->getValue() == (unsigned short)N->getValue(); + 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 must have only it's 16 high bits set. -// The HI16 param means that only the higher 16 bits of the node -// immediate are caught. -// e.g. lui -def imm16ShiftedZExt : PatLeaf<(imm), [{ - return (N->getValue() & ~uint64_t(0xFFFF0000)) == 0; -}], HI16>; - // shamt field must fit in 5 bits. def immZExt5 : PatLeaf<(imm), [{ return N->getValue() == ((N->getValue()) & 0x1f) ; @@ -183,7 +178,7 @@ FI< op, (ops CPURegs:$dst, uimm16:$imm), !strconcat(instr_asm, " $dst, $imm"), - [(set CPURegs:$dst, imm16ShiftedZExt:$imm)]>; + []>; // Memory Load/Store let isLoad = 1 in @@ -308,8 +303,8 @@ //===----------------------------------------------------------------------===// // Arithmetic -def ADDi : ArithI<0x08, "addi", add, simm16, immZExt16>; def ADDiu : ArithI<0x09, "addiu", add, uimm16, immSExt16>; +def ADDi : ArithI<0x08, "addi", add, simm16, immZExt16>; def MUL : ArithR<0x1c, 0x02, "mul", mul>; def ADDu : ArithR<0x00, 0x21, "addu", add>; def SUBu : ArithR<0x00, 0x23, "subu", sub>; @@ -403,6 +398,8 @@ // Small immediates def : Pat<(i32 immSExt16:$in), + (ADDiu ZERO, imm:$in)>; +def : Pat<(i32 immZExt16:$in), (ORi ZERO, imm:$in)>; // Arbitrary immediates @@ -434,6 +431,10 @@ def : Pat<(truncstorei1 CPURegs:$src, addr:$addr), (SB CPURegs:$src, addr:$src)>; +def : Pat<(brcond (setne CPURegs:$lhs, (add ZERO, 0)), bb:$dst), + (BNE CPURegs:$lhs, ZERO, bb:$dst)>; + + // Conditional branch patterns. // cond branches patterns, 2 register operands signed. def : Pat<(brcond (setlt CPURegs:$lhs, CPURegs:$rhs), bb:$dst), From bruno.cardoso at gmail.com Wed Jul 11 18:16:17 2007 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 11 Jul 2007 23:16:17 -0000 Subject: [llvm-commits] [llvm] r39760 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Message-ID: <200707112316.l6BNGHWj014025@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 11 18:16:16 2007 New Revision: 39760 URL: http://llvm.org/viewvc/llvm-project?rev=39760&view=rev Log: Fixed AddLiveOut issues FI's created the write way to represent Mips stack Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=39760&r1=39759&r2=39760&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Wed Jul 11 18:16:16 2007 @@ -139,14 +139,14 @@ } // Set up a frame object for the return address. -SDOperand MipsTargetLowering::getReturnAddressFrameIndex(SelectionDAG &DAG) { - if (ReturnAddrIndex == 0) { - MachineFunction &MF = DAG.getMachineFunction(); - ReturnAddrIndex = MF.getFrameInfo()->CreateFixedObject(4, 0); - } - - return DAG.getFrameIndex(ReturnAddrIndex, getPointerTy()); -} +//SDOperand MipsTargetLowering::getReturnAddressFrameIndex(SelectionDAG &DAG) { +// if (ReturnAddrIndex == 0) { +// MachineFunction &MF = DAG.getMachineFunction(); +// ReturnAddrIndex = MF.getFrameInfo()->CreateFixedObject(4, 0); +// } +// +// return DAG.getFrameIndex(ReturnAddrIndex, getPointerTy()); +//} //===----------------------------------------------------------------------===// @@ -170,17 +170,6 @@ assert(0 && "TLS not implemented for MIPS."); } -SDOperand MipsTargetLowering:: -LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG) { - // Depths > 0 not supported yet! - if (cast(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); -} - //===----------------------------------------------------------------------===// // Calling Convention Implementation // @@ -222,17 +211,28 @@ SDOperand MipsTargetLowering:: LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC) { + MachineFunction &MF = DAG.getMachineFunction(); + unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF); + SDOperand Chain = Op.getOperand(0); SDOperand Callee = Op.getOperand(4); + bool isVarArg = cast(Op.getOperand(2))->getValue() != 0; + + MachineFrameInfo *MFI = MF.getFrameInfo(); // Analyze operands of the call, assigning locations to each operand. SmallVector ArgLocs; - CCState CCInfo(CC, getTargetMachine(), 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())); @@ -268,17 +268,19 @@ if (VA.isRegLoc()) { RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg)); } else { + assert(VA.isMemLoc()); - // Mips::SP holds our stack pointer + if (StackPtr.Val == 0) - StackPtr = DAG.getRegister(Mips::SP, getPointerTy()); + StackPtr = DAG.getRegister(StackReg, getPointerTy()); - SDOperand PtrOff = DAG.getConstant(VA.getLocMemOffset(), - getPointerTy()); - - // emit a ISD::ADD which emits the final - // stack location to place the parameter - PtrOff = DAG.getNode(ISD::ADD, getPointerTy(), StackPtr, PtrOff); + // Create the frame index object for this incoming parameter + // This guarantees that when allocating Local Area our room + // will not be overwritten. + int FI = MFI->CreateFixedObject(MVT::getSizeInBits(VA.getValVT())/8, + -(16 + VA.getLocMemOffset()) ); + + SDOperand PtrOff = DAG.getFrameIndex(FI,getPointerTy()); // emit ISD::STORE whichs stores the // parameter value to a stack Location @@ -287,7 +289,7 @@ } // Transform all store nodes into one single node because - // all store nodes ar independent of each other. + // all store nodes are independent of each other. if (!MemOpChains.empty()) Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &MemOpChains[0], MemOpChains.size()); @@ -356,13 +358,16 @@ LowerCallResult(SDOperand Chain, SDOperand InFlag, SDNode *TheCall, unsigned CallingConv, SelectionDAG &DAG) { + bool isVarArg = cast(TheCall->getOperand(2))->getValue() != 0; + // Assign locations to each value returned by this call. SmallVector RVLocs; - CCState CCInfo(CallingConv, getTargetMachine(), RVLocs); + CCState CCInfo(CallingConv, isVarArg, getTargetMachine(), RVLocs); + CCInfo.AnalyzeCallResult(TheCall, RetCC_Mips); SmallVector ResultVals; - // returns void + // Returns void if (!RVLocs.size()) return Chain.Val; @@ -405,16 +410,22 @@ SDOperand MipsTargetLowering:: LowerCCCArguments(SDOperand Op, SelectionDAG &DAG) { + SDOperand Root = Op.getOperand(0); MachineFunction &MF = DAG.getMachineFunction(); MachineFrameInfo *MFI = MF.getFrameInfo(); - SDOperand Root = Op.getOperand(0); + + bool isVarArg = cast(Op.getOperand(2))->getValue() != 0; + unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv(); + + unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF); // Assign locations to all of the incoming arguments. SmallVector ArgLocs; - CCState CCInfo(MF.getFunction()->getCallingConv(), - getTargetMachine(), ArgLocs); + CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs); + CCInfo.AnalyzeFormalArguments(Op.Val, CC_Mips); SmallVector ArgValues; + SDOperand StackPtr; for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { @@ -430,10 +441,10 @@ else assert(0 && "support only Mips::CPURegsRegisterClass"); - unsigned Reg = AddLiveIn(DAG.getMachineFunction(), VA.getLocReg(), RC); // 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 @@ -451,13 +462,32 @@ ArgValues.push_back(ArgValue); + // To meet ABI, when VARARGS are passed on registers, the registers + // containt must be written to the their always reserved home location + // on the stack. + if (isVarArg) { + + if (StackPtr.Val == 0) + StackPtr = DAG.getRegister(StackReg, getPointerTy()); + + // Create the frame index object for this incoming parameter + // The first 16 bytes are reserved. + int FI = MFI->CreateFixedObject(MVT::getSizeInBits(VA.getValVT())/8, + 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()); // Create the frame index object for this incoming parameter... int FI = MFI->CreateFixedObject(MVT::getSizeInBits(VA.getValVT())/8, - VA.getLocMemOffset()); + (16 + VA.getLocMemOffset())); // Create load nodes to retrieve arguments from the stack SDOperand FIN = DAG.getFrameIndex(FI, getPointerTy()); @@ -466,8 +496,6 @@ } ArgValues.push_back(Root); - ReturnAddrIndex = 0; - // Return the new list of results. return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(), &ArgValues[0], ArgValues.size()).getValue(Op.ResNo); @@ -483,10 +511,11 @@ // CCValAssign - represent the assignment of // the return value to a location SmallVector RVLocs; - unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv(); + unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv(); + bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg(); // CCState - Info about the registers and stack slot. - CCState CCInfo(CC, getTargetMachine(), RVLocs); + CCState CCInfo(CC, isVarArg, getTargetMachine(), RVLocs); // Analize return values of ISD::RET CCInfo.AnalyzeReturn(Op.Val, RetCC_Mips); @@ -495,7 +524,8 @@ // the regs to the liveout set for the function. if (DAG.getMachineFunction().liveout_empty()) { for (unsigned i = 0; i != RVLocs.size(); ++i) - DAG.getMachineFunction().addLiveOut(RVLocs[i].getLocReg()); + if (RVLocs[i].isRegLoc()) + DAG.getMachineFunction().addLiveOut(RVLocs[i].getLocReg()); } // The chain is always operand #0 From bruno.cardoso at gmail.com Wed Jul 11 18:17:42 2007 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 11 Jul 2007 23:17:42 -0000 Subject: [llvm-commits] [llvm] r39761 - /llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Message-ID: <200707112317.l6BNHgiB014079@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 11 18:17:41 2007 New Revision: 39761 URL: http://llvm.org/viewvc/llvm-project?rev=39761&view=rev Log: Now that stack is represented the right way, LOA starts at 0 Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=39761&r1=39760&r2=39761&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Wed Jul 11 18:17:41 2007 @@ -31,23 +31,24 @@ } // DataLayout --> Big-endian, 32-bit pointer/ABI/alignment -// FrameInfo --> StackGrowsDown, 8 bytes aligned, LOA : -4 (Ra : 0) +// +// FrameInfo --> StackGrowsDown, 8 bytes aligned, +// LOA : 0 MipsTargetMachine:: MipsTargetMachine(const Module &M, const std::string &FS): Subtarget(*this, M, FS), DataLayout("E-p:32:32:32"), - InstrInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -4), + InstrInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0), TLInfo(*this) {} // return 0 and must specify -march to gen MIPS code. unsigned MipsTargetMachine:: -getModuleMatchQuality(const Module &M) { +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; - // If the target triple is something non-mips, we don't match. - if (!TT.empty()) return 0; - + return 0; } From resistor at mac.com Wed Jul 11 18:19:17 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 11 Jul 2007 23:19:17 -0000 Subject: [llvm-commits] [llvm] r39762 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707112319.l6BNJHHL014125@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 11 18:19:17 2007 New Revision: 39762 URL: http://llvm.org/viewvc/llvm-project?rev=39762&view=rev Log: Handle the case where an entire structure is freed, and its dependency is a store to a field within that structure. Also, refactor the runOnBasicBlock() function, splitting some of the special cases into separate functions. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39762&r1=39761&r2=39762&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Wed Jul 11 18:19:17 2007 @@ -23,7 +23,9 @@ #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; @@ -44,6 +46,9 @@ } bool runOnBasicBlock(BasicBlock &BB); + bool handleFreeWithNonTrivialDependency(FreeInst* F, StoreInst* dependency, + SetVector& possiblyDead); + bool handleEndBlock(BasicBlock& BB, SetVector& possiblyDead); void DeleteDeadInstructionChains(Instruction *I, SetVector &DeadInsts); @@ -51,7 +56,10 @@ // Dependence Graph) virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); + AU.addRequired(); + AU.addRequired(); AU.addRequired(); + AU.addPreserved(); AU.addPreserved(); } }; @@ -62,6 +70,7 @@ FunctionPass *llvm::createFastDeadStoreEliminationPass() { return new FDSE(); } bool FDSE::runOnBasicBlock(BasicBlock &BB) { + AliasAnalysis &AA = getAnalysis(); MemoryDependenceAnalysis& MD = getAnalysis(); // Record the last-seen store to this pointer @@ -92,6 +101,7 @@ // Remove it! MD.removeInstruction(last); + AA.deleteValue(last); // DCE instructions only used to calculate that store if (Instruction* D = dyn_cast(last->getOperand(0))) @@ -100,7 +110,10 @@ last->eraseFromParent(); NumFastStores++; MadeChange = true; - } + + // If this is a free, check for a non-trivial dependency + } else if (FreeInst* F = dyn_cast(BBI)) + MadeChange |= handleFreeWithNonTrivialDependency(F, last, possiblyDead); } // Update our most-recent-store map @@ -113,47 +126,8 @@ // 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) { - // Pointers alloca'd in this function are dead in the end block - SmallPtrSet 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(I)) - deadPointers.insert(AI); - - // Scan the basic block backwards - for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ){ - --BBI; - - if (deadPointers.empty()) - break; - - // If we find a store whose pointer is dead... - if (StoreInst* S = dyn_cast(BBI)) { - if (deadPointers.count(S->getPointerOperand())){ - // Remove it! - MD.removeInstruction(S); - - // DCE instructions only used to calculate that store - if (Instruction* D = dyn_cast(S->getOperand(0))) - possiblyDead.insert(D); - - BBI++; - S->eraseFromParent(); - NumFastStores++; - MadeChange = true; - } - - // If we encounter a use of the pointer, it is no longer considered dead - } else if (LoadInst* L = dyn_cast(BBI)) { - deadPointers.erase(L->getPointerOperand()); - } else if (VAArgInst* V = dyn_cast(BBI)) { - deadPointers.erase(V->getOperand(0)); - } - } - } + if (BB.getTerminator()->getNumSuccessors() == 0) + MadeChange |= handleEndBlock(BB, possiblyDead); // Do a trivial DCE while (!possiblyDead.empty()) { @@ -165,6 +139,90 @@ return MadeChange; } +/// handleFreeWithNonTrivialDependency - Handle frees of entire structures whose +/// dependency is a store to a field of that structure +bool FDSE::handleFreeWithNonTrivialDependency(FreeInst* F, StoreInst* dependency, + SetVector& possiblyDead) { + TargetData &TD = getAnalysis(); + AliasAnalysis &AA = getAnalysis(); + MemoryDependenceAnalysis& MD = getAnalysis(); + + Value* depPointer = dependency->getPointerOperand(); + unsigned depPointerSize = TD.getTypeSize(dependency->getOperand(0)->getType()); + + // Check for aliasing + AliasAnalysis::AliasResult A = AA.alias(F->getPointerOperand(), ~0UL, + depPointer, depPointerSize); + + if (A == AliasAnalysis::MustAlias) { + // Remove it! + MD.removeInstruction(dependency); + AA.deleteValue(dependency); + + // DCE instructions only used to calculate that store + if (Instruction* D = dyn_cast(dependency->getOperand(0))) + possiblyDead.insert(D); + + dependency->eraseFromParent(); + NumFastStores++; + return true; + } + + return false; +} + +/// handleEndBlock - Remove dead stores to stack-allocated locations in the function +/// end block +bool FDSE::handleEndBlock(BasicBlock& BB, SetVector& possiblyDead) { + AliasAnalysis &AA = getAnalysis(); + MemoryDependenceAnalysis &MD = getAnalysis(); + + bool MadeChange = false; + + // Pointers alloca'd in this function are dead in the end block + SmallPtrSet 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(I)) + deadPointers.insert(AI); + + // Scan the basic block backwards + for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ){ + --BBI; + + if (deadPointers.empty()) + break; + + // If we find a store whose pointer is dead... + if (StoreInst* S = dyn_cast(BBI)) { + if (deadPointers.count(S->getPointerOperand())){ + // Remove it! + MD.removeInstruction(S); + AA.deleteValue(S); + + // DCE instructions only used to calculate that store + if (Instruction* D = dyn_cast(S->getOperand(0))) + possiblyDead.insert(D); + + BBI++; + S->eraseFromParent(); + NumFastStores++; + MadeChange = true; + } + + // If we encounter a use of the pointer, it is no longer considered dead + } else if (LoadInst* L = dyn_cast(BBI)) { + deadPointers.erase(L->getPointerOperand()); + } else if (VAArgInst* V = dyn_cast(BBI)) { + deadPointers.erase(V->getOperand(0)); + } + } + + return MadeChange; +} + void FDSE::DeleteDeadInstructionChains(Instruction *I, SetVector &DeadInsts) { // Instruction must be dead. @@ -172,6 +230,7 @@ // Let the memory dependence know getAnalysis().removeInstruction(I); + getAnalysis().deleteValue(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 From bruno.cardoso at gmail.com Wed Jul 11 18:21:31 2007 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 11 Jul 2007 23:21:31 -0000 Subject: [llvm-commits] [llvm] r39763 - /llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp Message-ID: <200707112321.l6BNLVAd014187@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 11 18:21:31 2007 New Revision: 39763 URL: http://llvm.org/viewvc/llvm-project?rev=39763&view=rev Log: Added support for framepointer Prologue/Epilogue support fp,ra save/restore and use the stack frame the right way! Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp?rev=39763&r1=39762&r2=39763&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp Wed Jul 11 18:21:31 2007 @@ -15,6 +15,7 @@ #include "Mips.h" #include "MipsRegisterInfo.h" +#include "MipsMachineFunction.h" #include "llvm/Constants.h" #include "llvm/Type.h" #include "llvm/Function.h" @@ -46,8 +47,8 @@ const TargetRegisterClass *RC) const { if (RC == Mips::CPURegsRegisterClass) - BuildMI(MBB, I, TII.get(Mips::SW)).addFrameIndex(FI) - .addImm(0).addReg(SrcReg, false, false, true); + BuildMI(MBB, I, TII.get(Mips::SW)).addReg(SrcReg, false, false, true) + .addImm(0).addFrameIndex(FI); else assert(0 && "Can't store this register to stack slot"); } @@ -154,13 +155,62 @@ } //===----------------------------------------------------------------------===// +// // Stack Frame Processing methods +// +----------------------------+ +// +// Too meet ABI, we construct the frame on the reverse +// of natural order. +// +// The LLVM Frame will look like this: +// +// As the stack grows down, we start at 0, and the reference +// is decrement. +// +// 0 ---------- +// -4 Args to pass +// . saved "Callee Saved" Registers +// . Local Area +// . saved FP +// . saved RA +// -StackSize ----------- +// +// On the EliminateFrameIndex we just negate the address above +// and we get the stack frame required by the ABI, which is: +// +// sp + stacksize ------------- +// saved $RA (only on non-leaf functions) +// saved $FP (only with frame pointer) +// saved "Callee Saved" Registers +// Local Area +// saved $GP (used in PIC - not supported yet) +// Args to pass area +// sp ------------- +// +// 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 fixed location stack frames using positive stack offsets. +// +// Examples: +// - reference to the actual stack frame +// for any local area var there is smt like : FI >= 0, StackOffset: -4 +// sw REGX, 4(REGY) +// +// - reference to previous stack frame +// suppose there's a store to the 5th arguments : FI < 0, StackOffset: 16. +// The emitted instruction will be something like: +// sw REGX, 16+StackSize (REGY) +// //===----------------------------------------------------------------------===// -// True if target has frame pointer +// 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 false; + return (NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects()); } // This function eliminate ADJCALLSTACKDOWN, @@ -179,35 +229,30 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, RegScavenger *RS) const { - unsigned i = 0; 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!"); } - // FrameInfo addressable stack objects are accessed - // using neg. offsets, so we must add with the stack - // size to obtain $sp relative address. int FrameIndex = MI.getOperand(i).getFrameIndex(); int stackSize = MF.getFrameInfo()->getStackSize(); int spOffset = MF.getFrameInfo()->getObjectOffset(FrameIndex); #ifndef NDEBUG - DOUT << "\n<--------->\n"; + DOUT << "\nFunction : " << MF.getFunction()->getName() << "\n"; + DOUT << "<--------->\n"; MI.print(DOUT); DOUT << "FrameIndex : " << FrameIndex << "\n"; DOUT << "spOffset : " << spOffset << "\n"; DOUT << "stackSize : " << stackSize << "\n"; #endif - // If the FrameIndex points to a positive SPOffset this - // means we are inside the callee and getting the arguments - // from the caller stack - int Offset = (-(stackSize)) + spOffset; + int Offset = ( (spOffset >= 0) ? (stackSize + spOffset) : (-spOffset)); #ifndef NDEBUG DOUT << "Offset : " << Offset << "\n"; @@ -215,51 +260,141 @@ #endif MI.getOperand(i-1).ChangeToImmediate(Offset); - MI.getOperand(i).ChangeToRegister(Mips::SP,false); + MI.getOperand(i).ChangeToRegister(getFrameRegister(MF),false); } void MipsRegisterInfo:: emitPrologue(MachineFunction &MF) const { - MachineBasicBlock &MBB = MF.front(); - MachineFrameInfo *MFI = MF.getFrameInfo(); + MachineBasicBlock &MBB = MF.front(); + MachineFrameInfo *MFI = MF.getFrameInfo(); + MipsFunctionInfo *MipsFI = MF.getInfo(); + MachineBasicBlock::iterator MBBI = MBB.begin(); // Get the number of bytes to allocate from the FrameInfo int NumBytes = (int) MFI->getStackSize(); + #ifndef NDEBUG + DOUT << "\n<--- EMIT PROLOGUE --->"; + DOUT << "Stack size :" << NumBytes << "\n"; + #endif + // Do we need to allocate space on the stack? if (NumBytes == 0) return; - // FIXME: is Stack Align needed here ?? (maybe it's done before...) + int FPOffset, RAOffset; + + // Always allocate space for saved RA and FP, + // even if FramePointer is not used. When not + // using FP, the last stack slot becomes empty + // and RA is saved before it. + if ((hasFP(MF)) && (MFI->hasCalls())) { + FPOffset = NumBytes; + RAOffset = (NumBytes+4); + } else if ((!hasFP(MF)) && (MFI->hasCalls())) { + FPOffset = 0; + RAOffset = NumBytes; + } else if ((hasFP(MF)) && (!MFI->hasCalls())) { + FPOffset = NumBytes; + RAOffset = 0; + } + + MFI->setObjectOffset(MFI->CreateStackObject(4,4), -FPOffset); + MFI->setObjectOffset(MFI->CreateStackObject(4,4), -RAOffset); + MipsFI->setFPStackOffset(FPOffset); + MipsFI->setRAStackOffset(RAOffset); + + #ifndef NDEBUG + DOUT << "FPOffset :" << FPOffset << "\n"; + DOUT << "RAOffset :" << RAOffset << "\n"; + #endif + + // Align stack. + NumBytes += 8; unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment(); - NumBytes = -((NumBytes+Align-1)/Align*Align); + NumBytes = ((NumBytes+Align-1)/Align*Align); - // Update frame info to pretend that this is part of the stack... + #ifndef NDEBUG + DOUT << "New stack size :" << NumBytes << "\n\n"; + #endif + + // Update frame info MFI->setStackSize(NumBytes); - // adjust stack : addi sp, sp, (-imm) - BuildMI(MBB, MBB.begin(), TII.get(Mips::ADDi), Mips::SP) - .addReg(Mips::SP).addImm(NumBytes); + // 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); + } } void MipsRegisterInfo:: emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const { MachineBasicBlock::iterator MBBI = prior(MBB.end()); - MachineFrameInfo *MFI = MF.getFrameInfo(); + MachineFrameInfo *MFI = MF.getFrameInfo(); + MipsFunctionInfo *MipsFI = MF.getInfo(); // 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(); + + #ifndef NDEBUG + DOUT << "\n<--- EMIT EPILOGUE --->" << "\n"; + DOUT << "Stack size :" << NumBytes << "\n"; + DOUT << "FPOffset :" << FPOffset << "\n"; + DOUT << "RAOffset :" << RAOffset << "\n\n"; + #endif + + // 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::ADDi), Mips::SP) - .addReg(Mips::SP).addImm(-NumBytes); + BuildMI(MBB, MBBI, TII.get(Mips::ADDiu), Mips::SP) + .addReg(Mips::SP).addImm(NumBytes); } } void MipsRegisterInfo:: -processFunctionBeforeFrameFinalized(MachineFunction &MF) const {} +processFunctionBeforeFrameFinalized(MachineFunction &MF) const { +} unsigned MipsRegisterInfo:: getRARegister() const { @@ -268,8 +403,7 @@ unsigned MipsRegisterInfo:: getFrameRegister(MachineFunction &MF) const { - assert(0 && "What is the frame register"); - return Mips::FP; + return hasFP(MF) ? Mips::FP : Mips::SP; } unsigned MipsRegisterInfo:: From bruno.cardoso at gmail.com Wed Jul 11 18:24:41 2007 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 11 Jul 2007 23:24:41 -0000 Subject: [llvm-commits] [llvm] r39764 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsISelDAGToDAG.cpp Message-ID: <200707112324.l6BNOfef014256@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 11 18:24:41 2007 New Revision: 39764 URL: http://llvm.org/viewvc/llvm-project?rev=39764&view=rev Log: Added support for Mips specific GAS directives Fixed print immediate Fixed Identation on MipsISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=39764&r1=39763&r2=39764&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Wed Jul 11 18:24:41 2007 @@ -17,12 +17,14 @@ #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" @@ -30,6 +32,7 @@ #include "llvm/Support/Mangler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/MathExtras.h" #include @@ -48,10 +51,25 @@ 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); + void printHex32(unsigned int Value); + void emitFunctionStart(MachineFunction &MF); + void emitFunctionEnd(); + void emitFrameDirective(MachineFunction &MF); + void emitMaskDirective(MachineFunction &MF); + void emitFMaskDirective(); + void emitSetDirective(SetDirectiveFlags Flag); + bool printInstruction(const MachineInstr *MI); // autogenerated. bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); @@ -71,6 +89,139 @@ return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo()); } +/// This pattern will be emitted : +/// .frame reg1, size, reg2 +/// It describes the stack frame. +/// reg1 - stack pointer +/// size - stack size allocated for the function +/// reg2 - return address register +void MipsAsmPrinter:: +emitFrameDirective(MachineFunction &MF) +{ + const MRegisterInfo &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).Name) + << "," << stackSize << "," + << "$" << LowercaseString(RI.get(returnReg).Name) + << "\n"; +} + +/// This pattern will be emitted : +/// .mask bitmask, offset +/// Tells the assembler (and possibly linker) which registers are saved and where. +/// bitmask - mask of all GPRs (little endian) +/// offset - negative value. offset+stackSize should give where on the stack +/// the first GPR is saved. +/// TODO: consider calle saved GPR regs here, not hardcode register numbers. +void MipsAsmPrinter:: +emitMaskDirective(MachineFunction &MF) +{ + const MRegisterInfo &RI = *TM.getRegisterInfo(); + MipsFunctionInfo *MipsFI = MF.getInfo(); + + bool hasFP = RI.hasFP(MF); + bool saveRA = MF.getFrameInfo()->hasCalls(); + + int offset; + + if (!MipsFI->getTopSavedRegOffset()) + offset = 0; + else + offset = -(MF.getFrameInfo()->getStackSize() + -MipsFI->getTopSavedRegOffset()); + + #ifndef NDEBUG + DOUT << "<--ASM PRINTER--emitMaskDirective-->" << "\n"; + DOUT << "StackSize : " << MF.getFrameInfo()->getStackSize() << "\n"; + DOUT << "getTopSavedRegOffset() : " << MipsFI->getTopSavedRegOffset() << "\n"; + DOUT << "offset : " << offset << "\n\n"; + #endif + + unsigned int bitmask = 0; + + if (hasFP) + bitmask |= (1 << 30); + + if (saveRA) + bitmask |= (1 << 31); + + O << "\t.mask\t"; + printHex32(bitmask); + O << "," << offset << "\n"; +} + +/// This pattern will be emitted : +/// .fmask bitmask, offset +/// Tells the assembler (and possibly linker) which float registers are saved. +/// bitmask - mask of all Float Point registers (little endian) +/// offset - negative value. offset+stackSize should give where on the stack +/// the first Float Point register is saved. +/// TODO: implement this, dummy for now +void MipsAsmPrinter:: +emitFMaskDirective() +{ + O << "\t.fmask\t0x00000000,0" << "\n"; +} + +/// Print a 32 bit hex number filling with 0's on the left. +/// TODO: make this setfill and setw +void MipsAsmPrinter:: +printHex32(unsigned int Value) { + O << "0x" << std::hex << Value << std::dec; +} + +/// 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; + } +} + +/// 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); + + // On Mips GAS, if .align #n is present, #n means the number of bits + // to be cleared. So, if we want 4 byte alignment, we must have .align 2 + EmitAlignment(1, 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(); + + emitSetDirective(NOREORDER); + emitSetDirective(NOMACRO); +} + +/// Emit the directives used by GAS on the end of functions +void MipsAsmPrinter:: +emitFunctionEnd() { + emitSetDirective(MACRO); + emitSetDirective(REORDER); + O << "\t.end\t" << CurrentFnName << "\n"; +} + /// runOnMachineFunction - This uses the printMachineInstruction() /// method to print assembly for each instruction. bool MipsAsmPrinter:: @@ -86,20 +237,8 @@ // 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); - - // On Mips GAS if .align #n is present, #n means the number of bits - // to be cleared to align. So, if we want 4 byte alignment, we must - // have .align 2 - // TODO: - // add gas ".mask" and ".fmask" - EmitAlignment(1, F); - O << "\t.globl\t" << CurrentFnName << "\n"; - O << "\t.ent\t" << CurrentFnName << "\n"; - O << "\t.type\t" << CurrentFnName << ", @function\n"; - O << CurrentFnName << ":\n"; + // Emit the function start directives + emitFunctionStart(MF); // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); @@ -120,8 +259,8 @@ } } - // close function with asm directive - O << "\t.end\t" << CurrentFnName << "\n"; + // Emit function end directives + emitFunctionEnd(); // We didn't modify anything. return false; @@ -156,10 +295,10 @@ case MachineOperand::MO_Immediate: if ((MI->getOpcode() == Mips::SLTiu) || (MI->getOpcode() == Mips::ORi) || - (MI->getOpcode() == Mips::LUi) || (MI->getOpcode() == Mips::ANDi)) - O << (unsigned int)MO.getImmedValue(); + (MI->getOpcode() == Mips::LUi) || (MI->getOpcode() == Mips::ANDi)) + O << (unsigned short int)MO.getImmedValue(); else - O << (int)MO.getImmedValue(); + O << (short int)MO.getImmedValue(); break; case MachineOperand::MO_MachineBasicBlock: Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp?rev=39764&r1=39763&r2=39764&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Wed Jul 11 18:24:41 2007 @@ -163,7 +163,7 @@ } } - Base = Addr; + Base = Addr; Offset = CurDAG->getTargetConstant(0, MVT::i32); return true; } From greened at obbligato.org Wed Jul 11 18:44:08 2007 From: greened at obbligato.org (David Greene) Date: Wed, 11 Jul 2007 23:44:08 -0000 Subject: [llvm-commits] [llvm] r39766 - /llvm/trunk/Makefile Message-ID: <200707112344.l6BNi8f0015001@zion.cs.uiuc.edu> Author: greened Date: Wed Jul 11 18:44:08 2007 New Revision: 39766 URL: http://llvm.org/viewvc/llvm-project?rev=39766&view=rev Log: Get rid of annoying spaces. Modified: llvm/trunk/Makefile Modified: llvm/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=39766&r1=39765&r2=39766&view=diff ============================================================================== --- llvm/trunk/Makefile (original) +++ llvm/trunk/Makefile Wed Jul 11 18:44:08 2007 @@ -19,7 +19,7 @@ # DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \ tools runtime docs - + OPTIONAL_DIRS := examples projects EXTRA_DIST := test llvm.spec include win32 Xcode From dpatel at apple.com Wed Jul 11 18:47:29 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 11 Jul 2007 23:47:29 -0000 Subject: [llvm-commits] [llvm] r39767 - /llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200707112347.l6BNlThF015244@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jul 11 18:47:28 2007 New Revision: 39767 URL: http://llvm.org/viewvc/llvm-project?rev=39767&view=rev Log: Preserve analysis info. Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=39767&r1=39766&r2=39767&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Wed Jul 11 18:47:28 2007 @@ -18,7 +18,10 @@ #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" @@ -55,6 +58,17 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(LCSSAID); AU.addPreservedID(LCSSAID); + AU.addPreserved(); + AU.addPreserved(); + AU.addRequiredID(LoopSimplifyID); + AU.addPreservedID(LoopSimplifyID); + AU.addPreserved(); + // Request DominanceFrontier now, even though Loop Rotate does + // not use it. This allows Pass Manager to schedule Dominance + // Frontier early enough such that one LPPassManager can handle + // loop rotate as well as licm pass. + AU.addRequired(); + AU.addPreserved(); } // Helper functions @@ -90,7 +104,7 @@ BasicBlock *OrigLatch; BasicBlock *NewHeader; BasicBlock *Exit; - + LPPassManager *LPM_Ptr; SmallVector LoopHeaderInfo; }; @@ -103,9 +117,10 @@ /// 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)) { @@ -152,6 +167,13 @@ 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. @@ -163,13 +185,6 @@ assert(L->contains(NewHeader) && !L->contains(Exit) && "Unable to determine loop header and exit blocks"); - // 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. - // 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. @@ -314,18 +329,24 @@ U->replaceUsesOfWith(OldPhi, NewPhi); continue; } - - // Used inside Exit Block. Since we are in LCSSA form, U must be PHINode. - assert (U->getParent() == Exit - && "Need to propagate new PHI into Exit blocks"); - assert (isa(U) && "Use in Exit Block that is not PHINode"); - - PHINode *UPhi = cast(U); - - // UPhi already has one incoming argument from original header. - // Add second incoming argument from new Pre header. - UPhi->addIncoming(ILoopHeaderInfo.PreHeader, OrigPreHeader); + // Used inside Exit Block. Since we are in LCSSA form, U must be PHINode. + if (U->getParent() == Exit) { + assert (isa(U) && "Use in Exit Block that is not PHINode"); + + PHINode *UPhi = cast(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 = new PHINode(U->getType(), U->getName()); + PN->addIncoming(ILoopHeaderInfo.PreHeader, OrigPreHeader); + PN->addIncoming(OldPhi, OrigHeader); + Exit->getInstList().push_front(PN); + U->replaceUsesOfWith(OldPhi, PN); + } } } @@ -461,10 +482,105 @@ "Expected only one incoming value from Original PreHeader"); } + if (DominatorTree *DT = getAnalysisToUpdate()) { + 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()) { + + // 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(); + 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(I)); ++I) { + PHINode *NewPN = new PHINode(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"); + } From dpatel at apple.com Wed Jul 11 18:54:26 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 11 Jul 2007 23:54:26 -0000 Subject: [llvm-commits] [llvm] r39768 - /llvm/trunk/test/Transforms/LoopRotate/LRAnalysis.ll Message-ID: <200707112354.l6BNsQY9015609@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jul 11 18:54:25 2007 New Revision: 39768 URL: http://llvm.org/viewvc/llvm-project?rev=39768&view=rev Log: New test. Added: llvm/trunk/test/Transforms/LoopRotate/LRAnalysis.ll Added: llvm/trunk/test/Transforms/LoopRotate/LRAnalysis.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopRotate/LRAnalysis.ll?rev=39768&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopRotate/LRAnalysis.ll (added) +++ llvm/trunk/test/Transforms/LoopRotate/LRAnalysis.ll Wed Jul 11 18:54:25 2007 @@ -0,0 +1,21 @@ +; 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 ; [#uses=1] + br label %bb36 + +bb36: ; preds = %cond_true20, %entry + %c.2 = phi i32 [ %tmp33, %cond_true20 ], [ 0, %entry ] ; [#uses=1] + br i1 false, label %cond_true20, label %bb41 + +bb41: ; preds = %bb36 + %c.2.lcssa = phi i32 [ %c.2, %bb36 ] ; [#uses=0] + ret i32 0 + +bb44: ; preds = %entry + ret i32 0 +} From resistor at mac.com Wed Jul 11 19:06:21 2007 From: resistor at mac.com (Owen Anderson) Date: Thu, 12 Jul 2007 00:06:21 -0000 Subject: [llvm-commits] [llvm] r39769 - in /llvm/trunk/lib: Analysis/MemoryDependenceAnalysis.cpp Transforms/Scalar/FastDSE.cpp Message-ID: <200707120006.l6C06LrJ015916@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 11 19:06:21 2007 New Revision: 39769 URL: http://llvm.org/viewvc/llvm-project?rev=39769&view=rev Log: Let MemoryDependenceAnalysis take care of updating AliasAnalysis. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=39769&r1=39768&r2=39769&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Wed Jul 11 19:06:21 2007 @@ -255,4 +255,6 @@ reverseDep.erase(I); I = reverseDep.find(rem); } + + getAnalysis().deleteValue(rem); } Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39769&r1=39768&r2=39769&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Wed Jul 11 19:06:21 2007 @@ -70,7 +70,6 @@ FunctionPass *llvm::createFastDeadStoreEliminationPass() { return new FDSE(); } bool FDSE::runOnBasicBlock(BasicBlock &BB) { - AliasAnalysis &AA = getAnalysis(); MemoryDependenceAnalysis& MD = getAnalysis(); // Record the last-seen store to this pointer @@ -101,7 +100,6 @@ // Remove it! MD.removeInstruction(last); - AA.deleteValue(last); // DCE instructions only used to calculate that store if (Instruction* D = dyn_cast(last->getOperand(0))) @@ -157,7 +155,6 @@ if (A == AliasAnalysis::MustAlias) { // Remove it! MD.removeInstruction(dependency); - AA.deleteValue(dependency); // DCE instructions only used to calculate that store if (Instruction* D = dyn_cast(dependency->getOperand(0))) @@ -200,7 +197,6 @@ if (deadPointers.count(S->getPointerOperand())){ // Remove it! MD.removeInstruction(S); - AA.deleteValue(S); // DCE instructions only used to calculate that store if (Instruction* D = dyn_cast(S->getOperand(0))) @@ -230,7 +226,6 @@ // Let the memory dependence know getAnalysis().removeInstruction(I); - getAnalysis().deleteValue(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 From sabre at nondot.org Thu Jul 12 01:31:39 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 12 Jul 2007 06:31:39 -0000 Subject: [llvm-commits] [llvm] r39772 - /llvm/trunk/lib/Target/X86/README-SSE.txt Message-ID: <200707120631.l6C6VdRY031177@zion.cs.uiuc.edu> Author: lattner Date: Thu Jul 12 01:31:38 2007 New Revision: 39772 URL: http://llvm.org/viewvc/llvm-project?rev=39772&view=rev Log: another missed SSE optimization Modified: llvm/trunk/lib/Target/X86/README-SSE.txt Modified: llvm/trunk/lib/Target/X86/README-SSE.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=39772&r1=39771&r2=39772&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) +++ llvm/trunk/lib/Target/X86/README-SSE.txt Thu Jul 12 01:31:38 2007 @@ -598,3 +598,32 @@ } //===---------------------------------------------------------------------===// + +These functions should produce the same code: + +#include + +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 + +//===---------------------------------------------------------------------===// From ggreif at gmail.com Thu Jul 12 08:21:09 2007 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 12 Jul 2007 13:21:09 -0000 Subject: [llvm-commits] [llvm] r39773 - in /llvm/trunk/test/CodeGen/PowerPC: 2006-01-20-ShiftPartsCrash.ll 2006-08-15-SelectionCrash.ll or-addressing-mode.ll Message-ID: <200707121321.l6CDL9gO022343@zion.cs.uiuc.edu> Author: ggreif Date: Thu Jul 12 08:21:08 2007 New Revision: 39773 URL: http://llvm.org/viewvc/llvm-project?rev=39773&view=rev Log: fix the remaining 3 testcases that missed a target triple Modified: llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll llvm/trunk/test/CodeGen/PowerPC/or-addressing-mode.ll Modified: llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll?rev=39773&r1=39772&r2=39773&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll Thu Jul 12 08:21:08 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 void %iterative_hash_host_wide_int() { %zero = alloca int ; [#uses=2] Modified: llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll?rev=39773&r1=39772&r2=39773&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll Thu Jul 12 08:21:08 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 %struct..0anon = type { int } %struct.rtx_def = type { ushort, ubyte, ubyte, [1 x %struct..0anon] } Modified: llvm/trunk/test/CodeGen/PowerPC/or-addressing-mode.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/or-addressing-mode.ll?rev=39773&r1=39772&r2=39773&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/or-addressing-mode.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/or-addressing-mode.ll Thu Jul 12 08:21:08 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc | not grep ori -; RUN: llvm-upgrade < %s | llvm-as | llc | not grep rlwimi +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 | not grep ori +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 | not grep rlwimi int %test1(sbyte* %P) { ;; or -> lwzx %tmp.2.i = cast sbyte* %P to uint From ggreif at gmail.com Thu Jul 12 08:31:38 2007 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 12 Jul 2007 13:31:38 -0000 Subject: [llvm-commits] [llvm] r39774 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707121331.l6CDVcVJ022811@zion.cs.uiuc.edu> Author: ggreif Date: Thu Jul 12 08:31:38 2007 New Revision: 39774 URL: http://llvm.org/viewvc/llvm-project?rev=39774&view=rev Log: checked in as obvious, thanks Benoit Boissinot! Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39774&r1=39773&r2=39774&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Thu Jul 12 08:31:38 2007 @@ -171,7 +171,6 @@ /// handleEndBlock - Remove dead stores to stack-allocated locations in the function /// end block bool FDSE::handleEndBlock(BasicBlock& BB, SetVector& possiblyDead) { - AliasAnalysis &AA = getAnalysis(); MemoryDependenceAnalysis &MD = getAnalysis(); bool MadeChange = false; From baldrick at free.fr Thu Jul 12 08:51:40 2007 From: baldrick at free.fr (Duncan Sands) Date: Thu, 12 Jul 2007 13:51:40 -0000 Subject: [llvm-commits] [llvm] r39775 - /llvm/trunk/lib/CodeGen/DwarfWriter.cpp Message-ID: <200707121351.l6CDpeKF023976@zion.cs.uiuc.edu> Author: baldrick Date: Thu Jul 12 08:51:39 2007 New Revision: 39775 URL: http://llvm.org/viewvc/llvm-project?rev=39775&view=rev Log: The type ids making up a filter are unsigned, and should be output as unsigned values. Checked against gcc. Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=39775&r1=39774&r2=39775&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Thu Jul 12 08:51:39 2007 @@ -3002,7 +3002,7 @@ for(std::vector::const_iterator I = FilterIds.begin(), E = FilterIds.end(); I != E; ++I) { FilterOffsets.push_back(Offset); - Offset -= Asm->SizeSLEB128(*I); + Offset -= Asm->SizeULEB128(*I); } // Compute sizes for exception table. @@ -3191,7 +3191,7 @@ // Emit the filter typeids. for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) { unsigned TypeID = FilterIds[j]; - Asm->EmitSLEB128Bytes(TypeID); + Asm->EmitULEB128Bytes(TypeID); Asm->EOL("Filter TypeInfo index"); } From clattner at apple.com Thu Jul 12 10:40:06 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 12 Jul 2007 08:40:06 -0700 Subject: [llvm-commits] [llvm] r39773 - in /llvm/trunk/test/CodeGen/PowerPC: 2006-01-20-ShiftPartsCrash.ll 2006-08-15-SelectionCrash.ll or-addressing-mode.ll In-Reply-To: <200707121321.l6CDL9gO022343@zion.cs.uiuc.edu> References: <200707121321.l6CDL9gO022343@zion.cs.uiuc.edu> Message-ID: <9F263014-1515-40FF-BE26-554D821F6CF9@apple.com> > URL: http://llvm.org/viewvc/llvm-project?rev=39773&view=rev > Log: > fix the remaining 3 testcases that missed a target triple > ====================================================================== > ======== > --- llvm/trunk/test/CodeGen/PowerPC/or-addressing-mode.ll (original) > +++ llvm/trunk/test/CodeGen/PowerPC/or-addressing-mode.ll Thu Jul > 12 08:21:08 2007 > @@ -1,5 +1,5 @@ > -; RUN: llvm-upgrade < %s | llvm-as | llc | not grep ori > -; RUN: llvm-upgrade < %s | llvm-as | llc | not grep rlwimi > +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple- > darwin8 | not grep ori > +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple- > darwin8 | not grep rlwimi This one is fine, as you need PPC code for this test to be testing the right thing. Thanks! > --- llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll > (original) > +++ llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll > Thu Jul 12 08:21:08 2007 > @@ -1,4 +1,4 @@ > -; RUN: llvm-upgrade < %s | llvm-as | llc > +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple- > darwin8 > > --- llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll > (original) > +++ llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll > Thu Jul 12 08:21:08 2007 > @@ -1,4 +1,4 @@ > -; RUN: llvm-upgrade < %s | llvm-as | llc > +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple- > darwin8 However, these two don't seem to be PPC specific. Do you need to add the triple here? If so, something else is probably going wrong. If the triple isn't needed, please remove it. Thanks Gabor! -Chris From dalej at apple.com Thu Jul 12 11:45:36 2007 From: dalej at apple.com (Dale Johannesen) Date: Thu, 12 Jul 2007 16:45:36 -0000 Subject: [llvm-commits] [llvm] r39782 - in /llvm/trunk/lib/Target/ARM: ARMConstantIslandPass.cpp ARMInstrInfo.cpp Message-ID: <200707121645.l6CGjaoY002319@zion.cs.uiuc.edu> Author: johannes Date: Thu Jul 12 11:45:35 2007 New Revision: 39782 URL: http://llvm.org/viewvc/llvm-project?rev=39782&view=rev Log: ARM: make branch folder remove unconditional branches following jump tables that it earlier inserted. This would be OK on other targets but is needed for correctness only on ARM (constant islands needs to find jump tables). Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=39782&r1=39781&r2=39782&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Jul 12 11:45:35 2007 @@ -740,14 +740,11 @@ delta -= 2; } } - // Thumb jump tables require padding. They can be at the end, or - // followed by an unconditional branch. + // 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()); - else if (prior(MBB->end()) != MBB->begin() && - prior(prior(MBB->end()))->getOpcode() == ARM::tBR_JTr) - ThumbJTMI = prior(prior(MBB->end())); if (ThumbJTMI) { unsigned newMIOffset = GetOffsetOf(ThumbJTMI); unsigned oldMIOffset = newMIOffset - delta; Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp?rev=39782&r1=39781&r2=39782&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Thu Jul 12 11:45:35 2007 @@ -350,8 +350,8 @@ return false; } - // If the block ends with two B's or tB's, handle it. The second one is not - // executed, so remove it. + // 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).getMachineBasicBlock(); @@ -360,6 +360,17 @@ 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; } From alenhar2 at cs.uiuc.edu Thu Jul 12 12:00:24 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 12 Jul 2007 17:00:24 -0000 Subject: [llvm-commits] [poolalloc] r39787 - /poolalloc/branches/SVA/lib/DSA/Local.cpp Message-ID: <200707121700.l6CH0O1I003632@zion.cs.uiuc.edu> Author: alenhar2 Date: Thu Jul 12 12:00:24 2007 New Revision: 39787 URL: http://llvm.org/viewvc/llvm-project?rev=39787&view=rev Log: ignore llvm.used Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/DSA/Local.cpp?rev=39787&r1=39786&r2=39787&view=diff ============================================================================== --- poolalloc/branches/SVA/lib/DSA/Local.cpp (original) +++ poolalloc/branches/SVA/lib/DSA/Local.cpp Thu Jul 12 12:00:24 2007 @@ -1696,7 +1696,7 @@ // Add initializers for all of the globals to the globals graph. for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isExternal() && I->getName() != "llvm.used") GGB.mergeInGlobalInitializer(I); } From resistor at mac.com Thu Jul 12 12:52:21 2007 From: resistor at mac.com (Owen Anderson) Date: Thu, 12 Jul 2007 17:52:21 -0000 Subject: [llvm-commits] [llvm] r39788 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707121752.l6CHqLm2007785@zion.cs.uiuc.edu> Author: resistor Date: Thu Jul 12 12:52:20 2007 New Revision: 39788 URL: http://llvm.org/viewvc/llvm-project?rev=39788&view=rev Log: Remove the end-block handling code. It was unsafe, and making it safe would have resulted in falling back to the slow DSE case. I need to think some more about the right way to handle this. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39788&r1=39787&r2=39788&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Thu Jul 12 12:52:20 2007 @@ -122,11 +122,6 @@ } } - // 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(); @@ -168,56 +163,6 @@ return false; } -/// handleEndBlock - Remove dead stores to stack-allocated locations in the function -/// end block -bool FDSE::handleEndBlock(BasicBlock& BB, SetVector& possiblyDead) { - MemoryDependenceAnalysis &MD = getAnalysis(); - - bool MadeChange = false; - - // Pointers alloca'd in this function are dead in the end block - SmallPtrSet 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(I)) - deadPointers.insert(AI); - - // Scan the basic block backwards - for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ){ - --BBI; - - if (deadPointers.empty()) - break; - - // If we find a store whose pointer is dead... - if (StoreInst* S = dyn_cast(BBI)) { - if (deadPointers.count(S->getPointerOperand())){ - // Remove it! - MD.removeInstruction(S); - - // DCE instructions only used to calculate that store - if (Instruction* D = dyn_cast(S->getOperand(0))) - possiblyDead.insert(D); - - BBI++; - S->eraseFromParent(); - NumFastStores++; - MadeChange = true; - } - - // If we encounter a use of the pointer, it is no longer considered dead - } else if (LoadInst* L = dyn_cast(BBI)) { - deadPointers.erase(L->getPointerOperand()); - } else if (VAArgInst* V = dyn_cast(BBI)) { - deadPointers.erase(V->getOperand(0)); - } - } - - return MadeChange; -} - void FDSE::DeleteDeadInstructionChains(Instruction *I, SetVector &DeadInsts) { // Instruction must be dead. From resistor at mac.com Thu Jul 12 13:08:51 2007 From: resistor at mac.com (Owen Anderson) Date: Thu, 12 Jul 2007 18:08:51 -0000 Subject: [llvm-commits] [llvm] r39789 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707121808.l6CI8pGD009049@zion.cs.uiuc.edu> Author: resistor Date: Thu Jul 12 13:08:51 2007 New Revision: 39789 URL: http://llvm.org/viewvc/llvm-project?rev=39789&view=rev Log: Make the condition-checking for free with non-trivial dependencies more correct. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39789&r1=39788&r2=39789&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Thu Jul 12 13:08:51 2007 @@ -46,9 +46,8 @@ } bool runOnBasicBlock(BasicBlock &BB); - bool handleFreeWithNonTrivialDependency(FreeInst* F, StoreInst* dependency, + bool handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dependency, SetVector& possiblyDead); - bool handleEndBlock(BasicBlock& BB, SetVector& possiblyDead); void DeleteDeadInstructionChains(Instruction *I, SetVector &DeadInsts); @@ -91,6 +90,7 @@ assert(pointer && "Not a free or a store?"); StoreInst*& last = lastStore[pointer]; + bool deletedStore = false; // ... to a pointer that has been stored to before... if (last) { @@ -107,13 +107,17 @@ last->eraseFromParent(); NumFastStores++; + deletedStore = true; MadeChange = true; - - // If this is a free, check for a non-trivial dependency - } else if (FreeInst* F = dyn_cast(BBI)) - MadeChange |= handleFreeWithNonTrivialDependency(F, last, possiblyDead); + } } + // Handle frees whose dependencies are non-trivial + if (FreeInst* F = dyn_cast(BBI)) + if (!deletedStore) + MadeChange |= handleFreeWithNonTrivialDependency(F, MD.getDependency(F), + possiblyDead); + // Update our most-recent-store map if (StoreInst* S = dyn_cast(BBI)) last = S; @@ -134,12 +138,20 @@ /// handleFreeWithNonTrivialDependency - Handle frees of entire structures whose /// dependency is a store to a field of that structure -bool FDSE::handleFreeWithNonTrivialDependency(FreeInst* F, StoreInst* dependency, +bool FDSE::handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dep, SetVector& possiblyDead) { TargetData &TD = getAnalysis(); AliasAnalysis &AA = getAnalysis(); MemoryDependenceAnalysis& MD = getAnalysis(); + if (dep == MemoryDependenceAnalysis::None || + dep == MemoryDependenceAnalysis::NonLocal) + return false; + + StoreInst* dependency = dyn_cast(dep); + if (!dependency) + return false; + Value* depPointer = dependency->getPointerOperand(); unsigned depPointerSize = TD.getTypeSize(dependency->getOperand(0)->getType()); From resistor at mac.com Thu Jul 12 16:41:31 2007 From: resistor at mac.com (Owen Anderson) Date: Thu, 12 Jul 2007 21:41:31 -0000 Subject: [llvm-commits] [llvm] r39790 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Message-ID: <200707122141.l6CLfVgt021329@zion.cs.uiuc.edu> Author: resistor Date: Thu Jul 12 16:41:30 2007 New Revision: 39790 URL: http://llvm.org/viewvc/llvm-project?rev=39790&view=rev Log: Reimplement removing stores to allocas at the end of a function. This should be safe now. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39790&r1=39789&r2=39790&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Thu Jul 12 16:41:30 2007 @@ -17,6 +17,7 @@ #define DEBUG_TYPE "fdse" #include "llvm/Transforms/Scalar.h" +#include "llvm/Constants.h" #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Pass.h" @@ -48,6 +49,11 @@ bool runOnBasicBlock(BasicBlock &BB); bool handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dependency, SetVector& possiblyDead); + bool handleEndBlock(BasicBlock& BB, SetVector& possiblyDead); + bool RemoveUndeadPointers(Value* pointer, unsigned pointerSize, + BasicBlock::iterator& BBI, + SmallPtrSet& deadPointers, + SetVector& possiblyDead); void DeleteDeadInstructionChains(Instruction *I, SetVector &DeadInsts); @@ -126,6 +132,11 @@ } } + // 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(); @@ -175,6 +186,155 @@ return false; } +/// handleEndBlock - Remove dead stores to stack-allocated locations in the function +/// end block +bool FDSE::handleEndBlock(BasicBlock& BB, SetVector& possiblyDead) { + TargetData &TD = getAnalysis(); + AliasAnalysis &AA = getAnalysis(); + MemoryDependenceAnalysis& MD = getAnalysis(); + + bool MadeChange = false; + + // Pointers alloca'd in this function are dead in the end block + SmallPtrSet 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(I)) + deadPointers.insert(AI); + + // Scan the basic block backwards + for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ){ + --BBI; + + if (deadPointers.empty()) + break; + + Value* killPointer = 0; + unsigned killPointerSize = 0; + + // If we find a store whose pointer is dead... + if (StoreInst* S = dyn_cast(BBI)) { + if (deadPointers.count(S->getPointerOperand())){ + // Remove it! + MD.removeInstruction(S); + + // DCE instructions only used to calculate that store + if (Instruction* D = dyn_cast(S->getOperand(0))) + possiblyDead.insert(D); + + BBI++; + S->eraseFromParent(); + NumFastStores++; + MadeChange = true; + + // If we can't trivially delete this store, consider it undead + } else { + killPointer = S->getPointerOperand(); + killPointerSize = TD.getTypeSize(S->getOperand(0)->getType()); + } + + // If we encounter a use of the pointer, it is no longer considered dead + } else if (LoadInst* L = dyn_cast(BBI)) { + killPointer = L->getPointerOperand(); + killPointerSize = TD.getTypeSize(L->getType()); + } else if (VAArgInst* V = dyn_cast(BBI)) { + killPointer = V->getOperand(0); + killPointerSize = TD.getTypeSize(V->getType()); + } else if (FreeInst* F = dyn_cast(BBI)) { + killPointer = F->getPointerOperand(); + killPointerSize = ~0UL; + } else if (AllocaInst* A = dyn_cast(BBI)) { + deadPointers.erase(A); + continue; + } else if (CallSite::get(BBI).getInstruction() != 0) { + // Remove any pointers made undead by the call from the dead set + std::vector dead; + for (SmallPtrSet::iterator I = deadPointers.begin(), + E = deadPointers.end(); I != E; ++I) { + // Get size information for the alloca + unsigned pointerSize = ~0UL; + if (ConstantInt* C = dyn_cast((*I)->getArraySize())) + pointerSize = C->getZExtValue() * TD.getTypeSize((*I)->getAllocatedType()); + + // See if the call site touches it + AliasAnalysis::ModRefResult A = AA.getModRefInfo(CallSite::get(BBI), + *I, pointerSize); + if (A != AliasAnalysis::NoModRef) + dead.push_back(*I); + } + + for (std::vector::iterator I = dead.begin(), E = dead.end(); + I != E; ++I) + deadPointers.erase(*I); + + continue; + } + + if (!killPointer) + continue; + + // Deal with undead pointers + MadeChange |= RemoveUndeadPointers(killPointer, killPointerSize, BBI, + deadPointers, possiblyDead); + } + + return MadeChange; +} + +bool FDSE::RemoveUndeadPointers(Value* killPointer, unsigned killPointerSize, + BasicBlock::iterator& BBI, + SmallPtrSet& deadPointers, + SetVector& possiblyDead) { + TargetData &TD = getAnalysis(); + AliasAnalysis &AA = getAnalysis(); + MemoryDependenceAnalysis& MD = getAnalysis(); + + bool MadeChange = false; + + std::vector undead; + + for (SmallPtrSet::iterator I = deadPointers.begin(), + E = deadPointers.end(); I != E; ++I) { + // Get size information for the alloca + unsigned pointerSize = ~0UL; + if (ConstantInt* C = dyn_cast((*I)->getArraySize())) + pointerSize = C->getZExtValue() * TD.getTypeSize((*I)->getAllocatedType()); + + // 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(BBI) && A == AliasAnalysis::MustAlias) { + StoreInst* S = cast(BBI); + + // Remove it! + MD.removeInstruction(S); + + // DCE instructions only used to calculate that store + if (Instruction* D = dyn_cast(S->getOperand(0))) + 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::iterator I = undead.begin(), E = undead.end(); + I != E; ++I) + deadPointers.erase(*I); + + return MadeChange; +} + void FDSE::DeleteDeadInstructionChains(Instruction *I, SetVector &DeadInsts) { // Instruction must be dead. From baldrick at free.fr Fri Jul 13 03:39:35 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 08:39:35 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39798 - in /llvm-gcc-4-2/trunk: ./ fixincludes/ gcc/ gcc/ada/ gcc/autom4te.cache/ gcc/config/ gcc/config/arm/ gcc/config/i386/ gcc/config/ia64/ gcc/config/rs6000/ gcc/cp/ gcc/doc/ gcc/fortran/ gcc/java/ gcc/objc/ gcc/objcp/ libcpp/ libiberty/ libstdc++-v3/ libstdc++-v3/config/cpu/i486/ libstdc++-v3/config/cpu/powerpc/ libstdc++-v3/libsupc++/ Message-ID: <200707130839.l6D8dfkr019139@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 03:39:34 2007 New Revision: 39798 URL: http://llvm.org/viewvc/llvm-project?rev=39798&view=rev Log: Change APPLE local LLVM markers to LLVM local. Modified: llvm-gcc-4-2/trunk/GNUmakefile llvm-gcc-4-2/trunk/build_gcc llvm-gcc-4-2/trunk/fixincludes/inclhack.def llvm-gcc-4-2/trunk/gcc/Makefile.in llvm-gcc-4-2/trunk/gcc/ada/misc.c llvm-gcc-4-2/trunk/gcc/alias.c llvm-gcc-4-2/trunk/gcc/autom4te.cache/output.0 llvm-gcc-4-2/trunk/gcc/bt-load.c llvm-gcc-4-2/trunk/gcc/builtins.c llvm-gcc-4-2/trunk/gcc/c-common.c llvm-gcc-4-2/trunk/gcc/c-cppbuiltin.c llvm-gcc-4-2/trunk/gcc/c-decl.c llvm-gcc-4-2/trunk/gcc/c-incpath.c llvm-gcc-4-2/trunk/gcc/c-lex.c llvm-gcc-4-2/trunk/gcc/c-pch.c llvm-gcc-4-2/trunk/gcc/c-ppoutput.c llvm-gcc-4-2/trunk/gcc/c-typeck.c llvm-gcc-4-2/trunk/gcc/cgraph.c llvm-gcc-4-2/trunk/gcc/cgraphunit.c llvm-gcc-4-2/trunk/gcc/common.opt llvm-gcc-4-2/trunk/gcc/config.gcc llvm-gcc-4-2/trunk/gcc/config/arm/arm.c llvm-gcc-4-2/trunk/gcc/config/arm/arm.h llvm-gcc-4-2/trunk/gcc/config/arm/lib1funcs.asm llvm-gcc-4-2/trunk/gcc/config/arm/t-bpabi llvm-gcc-4-2/trunk/gcc/config/arm/t-symbian llvm-gcc-4-2/trunk/gcc/config/darwin.c llvm-gcc-4-2/trunk/gcc/config/darwin.h llvm-gcc-4-2/trunk/gcc/config/freebsd-spec.h llvm-gcc-4-2/trunk/gcc/config/i386/cygming.h llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.4.ver llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.5.ver llvm-gcc-4-2/trunk/gcc/config/i386/darwin.h llvm-gcc-4-2/trunk/gcc/config/i386/i386.c llvm-gcc-4-2/trunk/gcc/config/i386/i386.h llvm-gcc-4-2/trunk/gcc/config/i386/linux.h llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386.cpp llvm-gcc-4-2/trunk/gcc/config/ia64/ia64.h llvm-gcc-4-2/trunk/gcc/config/linux.h llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-ldouble.c llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.4.ver llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.5.ver llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin.h llvm-gcc-4-2/trunk/gcc/config/rs6000/llvm-rs6000.cpp llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.c llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.h llvm-gcc-4-2/trunk/gcc/config/rs6000/t-darwin8 llvm-gcc-4-2/trunk/gcc/configure llvm-gcc-4-2/trunk/gcc/configure.ac llvm-gcc-4-2/trunk/gcc/configure.merged llvm-gcc-4-2/trunk/gcc/cp/Make-lang.in llvm-gcc-4-2/trunk/gcc/cp/class.c llvm-gcc-4-2/trunk/gcc/cp/decl.c llvm-gcc-4-2/trunk/gcc/cp/decl2.c llvm-gcc-4-2/trunk/gcc/cp/lang-specs.h llvm-gcc-4-2/trunk/gcc/cp/method.c llvm-gcc-4-2/trunk/gcc/cp/parser.c llvm-gcc-4-2/trunk/gcc/cp/pt.c llvm-gcc-4-2/trunk/gcc/cp/typeck.c llvm-gcc-4-2/trunk/gcc/crtstuff.c llvm-gcc-4-2/trunk/gcc/cse.c llvm-gcc-4-2/trunk/gcc/doc/invoke.texi llvm-gcc-4-2/trunk/gcc/emit-rtl.c llvm-gcc-4-2/trunk/gcc/expr.c llvm-gcc-4-2/trunk/gcc/expr.h llvm-gcc-4-2/trunk/gcc/final.c llvm-gcc-4-2/trunk/gcc/flags.h llvm-gcc-4-2/trunk/gcc/fold-const.c llvm-gcc-4-2/trunk/gcc/fortran/Make-lang.in llvm-gcc-4-2/trunk/gcc/fortran/f95-lang.c llvm-gcc-4-2/trunk/gcc/fortran/trans-decl.c llvm-gcc-4-2/trunk/gcc/function.c llvm-gcc-4-2/trunk/gcc/gcc.c llvm-gcc-4-2/trunk/gcc/gimplify.c llvm-gcc-4-2/trunk/gcc/global.c llvm-gcc-4-2/trunk/gcc/java/Make-lang.in llvm-gcc-4-2/trunk/gcc/libgcc2.c llvm-gcc-4-2/trunk/gcc/llvm-abi.h llvm-gcc-4-2/trunk/gcc/llvm-backend.cpp llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp llvm-gcc-4-2/trunk/gcc/llvm-debug.cpp llvm-gcc-4-2/trunk/gcc/llvm-debug.h llvm-gcc-4-2/trunk/gcc/llvm-file-ostream.h llvm-gcc-4-2/trunk/gcc/llvm-internal.h llvm-gcc-4-2/trunk/gcc/llvm-linker-hack.cpp llvm-gcc-4-2/trunk/gcc/llvm-types.cpp llvm-gcc-4-2/trunk/gcc/llvm.h llvm-gcc-4-2/trunk/gcc/longlong.h llvm-gcc-4-2/trunk/gcc/objc/Make-lang.in llvm-gcc-4-2/trunk/gcc/objc/config-lang.in llvm-gcc-4-2/trunk/gcc/objc/lang-specs.h llvm-gcc-4-2/trunk/gcc/objc/objc-act.c llvm-gcc-4-2/trunk/gcc/objcp/Make-lang.in llvm-gcc-4-2/trunk/gcc/objcp/lang-specs.h llvm-gcc-4-2/trunk/gcc/optabs.c llvm-gcc-4-2/trunk/gcc/opts.c llvm-gcc-4-2/trunk/gcc/passes.c llvm-gcc-4-2/trunk/gcc/print-tree.c llvm-gcc-4-2/trunk/gcc/recog.c llvm-gcc-4-2/trunk/gcc/reload1.c llvm-gcc-4-2/trunk/gcc/simplify-rtx.c llvm-gcc-4-2/trunk/gcc/stor-layout.c llvm-gcc-4-2/trunk/gcc/stub-c.c llvm-gcc-4-2/trunk/gcc/system.h llvm-gcc-4-2/trunk/gcc/target-def.h llvm-gcc-4-2/trunk/gcc/timevar.def llvm-gcc-4-2/trunk/gcc/toplev.c llvm-gcc-4-2/trunk/gcc/toplev.h llvm-gcc-4-2/trunk/gcc/tree-gimple.c llvm-gcc-4-2/trunk/gcc/tree-inline.c llvm-gcc-4-2/trunk/gcc/tree-nested.c llvm-gcc-4-2/trunk/gcc/tree-optimize.c llvm-gcc-4-2/trunk/gcc/tree-pretty-print.c llvm-gcc-4-2/trunk/gcc/tree.c llvm-gcc-4-2/trunk/gcc/tree.h llvm-gcc-4-2/trunk/gcc/unwind-c.c llvm-gcc-4-2/trunk/gcc/varasm.c llvm-gcc-4-2/trunk/libcpp/Makefile.in llvm-gcc-4-2/trunk/libcpp/configure llvm-gcc-4-2/trunk/libcpp/configure.ac llvm-gcc-4-2/trunk/libcpp/system.h llvm-gcc-4-2/trunk/libiberty/strsignal.c llvm-gcc-4-2/trunk/libstdc++-v3/acinclude.m4 llvm-gcc-4-2/trunk/libstdc++-v3/config/cpu/i486/atomicity.h llvm-gcc-4-2/trunk/libstdc++-v3/config/cpu/powerpc/atomic_word.h llvm-gcc-4-2/trunk/libstdc++-v3/configure llvm-gcc-4-2/trunk/libstdc++-v3/libsupc++/eh_personality.cc llvm-gcc-4-2/trunk/libstdc++-v3/libsupc++/unwind-cxx.h Modified: llvm-gcc-4-2/trunk/GNUmakefile URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/GNUmakefile?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/GNUmakefile (original) +++ llvm-gcc-4-2/trunk/GNUmakefile Fri Jul 13 03:39:34 2007 @@ -34,7 +34,7 @@ ####################################################################### -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # LLVM defaults to enabled. ifndef DISABLE_LLVM ENABLE_LLVM = true @@ -65,7 +65,7 @@ $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) $(ENABLE_LLVM) \ $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) \ $(LLVM_ASSERTIONS) -# APPLE LOCAL end LLVM +# LLVM LOCAL end # installhdrs does nothing, because the headers aren't useful until # the compiler is installed. @@ -83,7 +83,7 @@ if [ $(SRCROOT) != . ]; then \ $(PAX) -rw . $(SRCROOT); \ fi - # APPLE LOCAL begin LLVM: Avoid verification error due to binaries in libjava. + # LLVM LOCAL begin: Avoid verification error due to binaries in libjava. rm -rf "$(SRCROOT)/libjava/" find -d "$(SRCROOT)" \( -type d -a -name CVS -o \ -type f -a -name .DS_Store -o \ Modified: llvm-gcc-4-2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/build_gcc?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/build_gcc (original) +++ llvm-gcc-4-2/trunk/build_gcc Fri Jul 13 03:39:34 2007 @@ -22,7 +22,7 @@ # installed. TARGETS=`echo $2 | $TRANSLATE_ARCH` -#APPLE LOCAL begin LLVM +#LLVM LOCAL begin # LLVM does not require host name translation. LLVM_HOSTS=$1 # LLVM target list is comma separated list. @@ -30,7 +30,7 @@ # -e s/x86_64// -e s/powerpc64// -e s/ppc64//` #FIXME : Hard code targets. See LLVMTARGETOBJ comment in gcc/Makefile.in LLVM_TARGETS="x86,powerpc" -#APPLE LOCAL end LLVM +#LLVM LOCAL end # The GNU makefile target ('bootstrap' by default). BOOTSTRAP=${BOOTSTRAP-bootstrap} @@ -67,7 +67,7 @@ # the resulting compiler. SYM_DIR="$6" -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # The seventh parameter is true/false indicating whether LLVM should be enabled # or not. ENABLE_LLVM="$7" @@ -92,7 +92,7 @@ LLVM_ARCHS="ppc i386 ppc64 x86_64" fi -# APPLE LOCAL end LLVM +# LLVM LOCAL end # The current working directory is where the build will happen. # It may already contain a partial result of an interrupted build, @@ -111,12 +111,12 @@ # to be built. It's VERS but only up to the second '.' (if there is one). MAJ_VERS=`echo $VERS | sed 's/\([0-9]*\.[0-9]*\)[.-].*/\1/'` -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin if [ "$ENABLE_LLVM" == true ]; then # Add suffix. MAJ_VERS="${MAJ_VERS}-llvm" fi -# APPLE LOCAL end LLVM +# LLVM LOCAL end # This is the libstdc++ version to use. LIBSTDCXX_VERSION=4.0.0 @@ -138,7 +138,7 @@ ln -s $ORIG_SRC_DIR/* $SRC_DIR/ || exit 1 rm -rf $SRC_DIR/tcl $SRC_DIR/expect $SRC_DIR/dejagnu || exit 1 -# APPLE LOCAL begin LLVM Must build libstdc++ to install in /usr/local. +# LLVM LOCAL begin Must build libstdc++ to install in /usr/local. LIBSTDCXX_CONFIG_OPTION= # Also remove libstdc++ since it is built from a separate project. rm -rf $SRC_DIR/libstdc++-v3 || exit 1 @@ -148,10 +148,10 @@ # Clean out old specs files rm -f /usr/lib/gcc/*/4.0.0/specs fi -# APPLE LOCAL end LLVM +# LLVM LOCAL end # These are the configure and build flags that are used. -# APPLE LOCAL begin LLVM Support for non /usr $DEST_ROOT, use libstdc++ +# LLVM LOCAL begin Support for non /usr $DEST_ROOT, use libstdc++ CONFIGFLAGS="--disable-checking --enable-werror \ --prefix=$DEST_ROOT \ @@ -161,9 +161,9 @@ $LIBSTDCXX_CONFIG_OPTION \ --with-slibdir=/usr/lib \ --build=$BUILD-apple-darwin$DARWIN_VERS" -# APPLE LOCAL end LLVM +# LLVM LOCAL end -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin if [ "$ENABLE_LLVM" == true ]; then CONFIGFLAGS="$CONFIGFLAGS --enable-llvm=$DIR/obj-llvm" @@ -196,7 +196,7 @@ exit 1 fi fi -# APPLE LOCAL LLVM end +# LLVM LOCAL end # Figure out how many make processes to run. SYSCTL=`sysctl -n hw.activecpu` @@ -216,7 +216,7 @@ # The $LOCAL_MAKEFLAGS variable can be used to override $MAKEFLAGS. MAKEFLAGS=${LOCAL_MAKEFLAGS-"-j $SYSCTL"} -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin if [ "$ENABLE_LLVM" == true ]; then # Build llvm-gcc in 'dylib mode'. MAKEFLAGS="$MAKEFLAGS BUILD_LLVM_INTO_A_DYLIB=1" @@ -226,7 +226,7 @@ MAKEFLAGS="$MAKEFLAGS DISABLE_LLVMASSERTIONS=1" fi fi -# APPLE LOCAL LLVM end +# LLVM LOCAL end # Build the native GCC. Do this even if the user didn't ask for it # because it'll be needed for the bootstrap. @@ -244,11 +244,11 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1 # Add the compiler we just built to the path, giving it appropriate names. -# APPLE LOCAL LLVM Support for non /usr $DEST_ROOT +# LLVM LOCAL Support for non /usr $DEST_ROOT D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin ln -f $D/gcc-$MAJ_VERS $D/gcc || exit 1 ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1 -# APPLE LOCAL LLVM Support for non /usr $DEST_ROOT +# LLVM LOCAL Support for non /usr $DEST_ROOT PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH # The cross-tools' build process expects to find certain programs @@ -290,7 +290,7 @@ make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$t install-gcc install-target \ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1 # Add the compiler we just built to the path. -# APPLE LOCAL LLVM Support for non /usr $DEST_ROOT +# LLVM LOCAL Support for non /usr $DEST_ROOT PATH=$DIR/dst-$BUILD-$t/$DEST_ROOT/bin:$PATH fi done @@ -298,7 +298,7 @@ # Rearrange various libraries, for no really good reason. for t in $TARGETS ; do DT=$DIR/dst-$BUILD-$t -# APPLE LOCAL begin LLVM Support for non /usr $DEST_ROOT +# LLVM LOCAL begin Support for non /usr $DEST_ROOT D=`echo $DT/$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS` mv $D/static/libgcc.a $D/libgcc_static.a || exit 1 mv $D/kext/libgcc.a $D/libcc_kext.a || exit 1 @@ -344,7 +344,7 @@ # Clean out DEST_DIR in case -noclean was passed to buildit. rm -rf * || exit 1 -# APPLE LOCAL LLVM Don't install HTML docs. +# LLVM LOCAL Don't install HTML docs. if [ "$ENABLE_LLVM" == false ]; then # HTML documentation HTMLDIR="/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools" @@ -353,7 +353,7 @@ # Manual pages mkdir -p .$DEST_ROOT/share || exit 1 -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT cp -Rp $DIR/dst-$BUILD-$BUILD/$DEST_ROOT/share/man .$DEST_ROOT/share/ \ || exit 1 # exclude fsf-funding.7 gfdl.7 gpl.7 as they are currently built in @@ -361,7 +361,7 @@ rm -rf .$DEST_ROOT/share/man/man7 # libexec -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT cd $DIR/dst-$BUILD-$BUILD/$DEST_ROOT/libexec/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS \ || exit 1 LIBEXEC_FILES=`find . -type f -print || exit 1` @@ -369,18 +369,18 @@ cd $DEST_DIR || exit 1 for t in $TARGETS ; do DL=$DEST_ROOT/libexec/gcc/$t-apple-darwin$DARWIN_VERS/$VERS - # APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT + # LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT SL=/$DEST_ROOT/libexec/gcc/$t-apple-darwin$DARWIN_VERS/$VERS for d in $LIBEXEC_DIRS ; do mkdir -p .$DL/$d || exit 1 done for f in $LIBEXEC_FILES ; do -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT, allow dynamically linked shared libs. +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT, allow dynamically linked shared libs. if file $DIR/dst-*-$t$SL/$f | grep -q -E 'Mach-O (executable|dynamically linked shared library)' ; then -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT lipo -output .$DL/$f -create $DIR/dst-*-$t$SL/$f || exit 1 else -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT cp -p $DIR/dst-$BUILD-$t$SL/$f .$DL/$f || exit 1 fi done @@ -394,21 +394,21 @@ | grep -v gccbug | grep -v gcov || exit 1` mkdir .$DEST_ROOT/bin for f in $BIN_FILES ; do -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT lipo -output .$DEST_ROOT/bin/$f -create $DIR/dst-*/$DEST_ROOT/bin/$f || exit 1 done # gcov, which is special only because it gets built multiple times and lipo # will complain if we try to add two architectures into the same output. TARG0=`echo $TARGETS | cut -d ' ' -f 1` -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT lipo -output .$DEST_ROOT/bin/gcov-$MAJ_VERS -create \ $DIR/dst-*-$TARG0/$DEST_ROOT/bin/*gcov* || exit 1 # The fully-named drivers, which have the same target on every host. for t in $TARGETS ; do -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS -create \ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS || exit 1 -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++-$VERS -create \ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++* || exit 1 done @@ -416,7 +416,7 @@ # lib mkdir -p .$DEST_ROOT/lib/gcc || exit 1 for t in $TARGETS ; do -# APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT +# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT cp -Rp $DIR/dst-$BUILD-$t/$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS \ .$DEST_ROOT/lib/gcc || exit 1 done @@ -448,7 +448,7 @@ cp -p /usr/lib/libstdc++.6.dylib \ .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \ || exit 1 -# APPLE LOCAL LLVM +# LLVM LOCAL # strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1 done @@ -547,15 +547,15 @@ find $DEST_DIR -perm -0111 \! -name \*.dylib \! -name fixinc.sh \ \! -name mkheaders \! -name libstdc++.dylib -type f -print \ | xargs strip || exit 1 -# APPLE LOCAL begin LLVM - Strip with -Sx instead of -SX +# LLVM LOCAL begin - Strip with -Sx instead of -SX find $DEST_DIR \( -name \*.a -or -name \*.dylib \) \ \! -name libgcc_s.10.*.dylib -type f -print \ | xargs strip -SX || exit 1 -# APPLE LOCAL end LLVM - Strip with -Sx instead of -SX +# LLVM LOCAL end - Strip with -Sx instead of -SX find $DEST_DIR -name \*.a -type f -print \ | xargs ranlib || exit 1 -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # Install LLVM libraries/headers/tools. if [ "$ENABLE_LLVM" == true ]; then cd $DIR/obj-llvm || exit 1 @@ -623,7 +623,7 @@ ln -s ../../libllvmgcc.dylib done fi -# APPLE LOCAL end LLVM +# LLVM LOCAL end find $DEST_DIR -name \*.dSYM -print | xargs rm -r || exit 1 chgrp -h -R wheel $DEST_DIR Modified: llvm-gcc-4-2/trunk/fixincludes/inclhack.def URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/fixincludes/inclhack.def?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/fixincludes/inclhack.def (original) +++ llvm-gcc-4-2/trunk/fixincludes/inclhack.def Fri Jul 13 03:39:34 2007 @@ -2520,7 +2520,7 @@ }; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ /* We need to fix complex.h not to include inline FP assembly. * This is needed to workaround PR879 */ @@ -2534,7 +2534,7 @@ test_text = ' __asm__ ("fpatan;"' ' : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)");'; }; -/* APPLE local end LLVM */ +/* LLVM local end */ /* * nested comment Modified: llvm-gcc-4-2/trunk/gcc/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/Makefile.in?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4-2/trunk/gcc/Makefile.in Fri Jul 13 03:39:34 2007 @@ -55,9 +55,9 @@ .SUFFIXES: .SUFFIXES: .c .o .po .pox .gmo -# APPLE LOCAL begin llvm +# LLVM LOCAL begin .SUFFIXES: .cpp -# APPLE LOCAL end llvm +# LLVM LOCAL end # ------------------------------- # Standard autoconf-set variables @@ -227,7 +227,7 @@ # $(GCC_WARN_CFLAGS), or nothing. WARN_CFLAGS = @warn_cflags@ -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin @checkingenabled_flag@ LLVMOBJDIR = @LLVMBASEPATH@ ifeq ($(LLVMOBJDIR),) @@ -254,7 +254,7 @@ # srcdir != objdir builds. LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root) endif -# APPLE LOCAL end LLVM +# LLVM LOCAL end # These exists to be overridden by the x-* and t-* files, respectively. X_CFLAGS = @@ -459,10 +459,10 @@ xmake_file=@xmake_file@ tmake_file=@tmake_file@ out_file=$(srcdir)/config/@out_file@ -# APPLE LOCAL LLVM +# LLVM LOCAL out_cxx_file=@out_cxx_file@ out_object_file=@out_object_file@ -# APPLE LOCAL LLVM +# LLVM LOCAL out_cxx_object_file=@out_cxx_object_file@ md_file=$(srcdir)/config/@md_file@ tm_file_list=@tm_file_list@ @@ -920,7 +920,7 @@ -I$(srcdir)/../include @INCINTL@ \ $(CPPINC) $(GMPINC) $(DECNUMINC) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin ifneq ($(LLVMOBJDIR),) INCLUDES += -I$(LLVMSRCDIR)/include @@ -930,11 +930,11 @@ INCLUDES += -I$(LLVMOBJDIR)/include endif endif -# APPLE LOCAL end LLVM +# LLVM LOCAL end .c.o: $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # Disable C-only warning flags if they are present. ALL_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes \ -Wold-style-definition, $(ALL_CFLAGS)) -Wno-unused @@ -947,7 +947,7 @@ .cpp.o: $(CXX) -c $(ALL_CXXFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) -# APPLE LOCAL end LLVM +# LLVM LOCAL end # # Support for additional languages (other than C). @@ -1097,20 +1097,20 @@ OBJS-md = $(out_object_file) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin ifneq ($(out_cxx_file),) ifneq ($(LLVMOBJDIR),) OBJC-md += $(out_cxx_object_file) endif endif -# APPLE LOCAL end LLVM +# LLVM LOCAL end OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) tree-inline.o \ cgraph.o cgraphunit.o tree-nomudflap.o ipa.o ipa-inline.o \ ipa-utils.o ipa-reference.o ipa-pure-const.o ipa-type-escape.o \ ipa-prop.o ipa-cp.o OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin ifneq ($(LLVMOBJDIR),) OBJS-common += llvm-backend.o llvm-convert.o llvm-types.o llvm-debug.o endif @@ -1161,12 +1161,12 @@ LIBDEPS += $(LLVMLIBFILES) LLVMBACKENDFILES := $(LLVMLIBFILES) -# APPLE LOCAL begin LLVM - set DYLD path +# LLVM LOCAL begin - set DYLD path SET_DYLIB_PATH=0 # Set up library path if needed. ##@set_gcc_lib_path@ -# APPLE LOCAL end LLVM - set DYLD path +# LLVM LOCAL end - set DYLD path else # Remove scheduler files. @@ -1177,12 +1177,12 @@ OBJS-common := $(filter-out bt-load.o caller-save.o combine.o cse.o ifcvt.o \ simplify-rtx.o, $(OBJS-common)) -# APPLE LOCAL begin LLVM - Remove gcse.o +# LLVM LOCAL begin - Remove gcse.o # Remove RTL optimization that requires a function we don't link in. ifdef BUILD_LLVM_INTO_A_DYLIB OBJS-common := $(filter-out gcse.o, $(OBJS-common)) endif -# APPLE LOCAL end LLVM - Remove gcse.o +# LLVM LOCAL end - Remove gcse.o # Remove generated files. OBJS-common := $(filter-out insn-attrtab.o insn-recog.o insn-extract.o, \ @@ -1206,31 +1206,31 @@ # Make sure that 'make install' knows about the dylib. EXTRA_PROGRAMS += libllvmgcc$(LLVM_STAGE).dylib -# APPLE LOCAL begin LLVM - set DYLD path +# LLVM LOCAL begin - set DYLD path SET_DYLIB_PATH=1 -# APPLE LOCAL end LLVM - set DYLD path +# LLVM LOCAL end - set DYLD path endif endif -# APPLE LOCAL end LLVM +# LLVM LOCAL end OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin ifneq ($(out_cxx_file),) ifneq ($(LLVMOBJDIR),) OBJS += $(out_cxx_object_file) endif endif -# APPLE LOCAL end LLVM +# LLVM LOCAL end OBJS-onestep = libbackend.o $(OBJS-archive) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin ifneq ($(LLVMOBJDIR),) MAIN_OBJ = llvm-main.o else MAIN_OBJ = main.o endif BACKEND = $(MAIN_OBJ) @TREEBROWSER@ libbackend.a $(CPPLIB) $(LLVMBACKENDFILES) -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Files to be copied after each stage in building. STAGECOPYSTUFF = insn-flags.h insn-config.h insn-codes.h \ @@ -1504,7 +1504,7 @@ $(AR) $(AR_FLAGS) libbackend.a $(OBJS at onestep@) -$(RANLIB) $(RANLIB_FLAGS) libbackend.a -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin ifneq ($(LLVMOBJDIR),) # Link with the C++ compiler, not the C compiler. LINKCC := $(CXX) @@ -1520,7 +1520,7 @@ else LINKCC := $(CC) endif -# APPLE LOCAL end LLVM +# LLVM LOCAL end # We call this executable `xgcc' rather than `gcc' # to avoid confusion if the current directory is in the path @@ -1823,10 +1823,10 @@ c-objc-common.h $(C_PRAGMA_H) c-common.def $(TREE_INLINE_H) stub-objc.o : stub-objc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ $(C_COMMON_H) -# APPLE LOCAL begin llvm +# LLVM LOCAL begin stub-c.o : stub-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ $(GGC_H) $(C_COMMON_H) -# APPLE LOCAL end llvm +# LLVM LOCAL end c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) $(REAL_H) $(SPLAY_TREE_H) \ $(C_PRAGMA_H) input.h intl.h $(FLAGS_H) toplev.h output.h \ @@ -1858,7 +1858,7 @@ COLLECT2_LIBS = @COLLECT2_LIBS@ collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS) # Don't try modifying collect2 (aka ld) in place--it might be linking this. - # APPLE LOCAL LLVM + # LLVM LOCAL $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o T$@ \ $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS) mv -f T$@ $@ @@ -2898,7 +2898,7 @@ $(TREE_H) errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(BCONFIG_H) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin llvm-main.o : llvm-main.cpp $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h llvm-symbol-stubs.o : llvm-symbol-stubs.cpp LLVM_HEADERS := $(wildcard $(LLVMSRCDIR)/include/llvm/*) \ @@ -2912,7 +2912,7 @@ $(LLVMSRCDIR)/include/llvm/Intrinsics.gen llvm-types.o : llvm-types.cpp $(ALL_HEADERS) llvm-debug.o : llvm-debug.cpp $(ALL_HEADERS) -# APPLE LOCAL end LLVM +# LLVM LOCAL end $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \ @@ -2921,7 +2921,7 @@ langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $(out_file) $(OUTPUT_OPTION) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin ifneq ($(out_cxx_file),) $(out_cxx_object_file): $(srcdir)/config/$(out_cxx_file) $(ALL_HEADERS) $(TREE_H) $(GGC_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \ @@ -2931,7 +2931,7 @@ $(CXX) -c $(ALL_CXXFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/$(out_cxx_file) $(OUTPUT_OPTION) endif -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Build auxiliary files that support ecoff format. mips-tfile: mips-tfile.o version.o $(LIBDEPS) @@ -2946,11 +2946,11 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ $(TM_H) version.h $(srcdir)/../include/getopt.h stab.def -# APPLE LOCAL LLVM - Disable rule, which expects OBJS-common to only have C Files. +# LLVM LOCAL - Disable rule, which expects OBJS-common to only have C Files. ifeq ($(LLVMOBJDIR),) # FIXME: writing proper dependencies for this is a *LOT* of work. -# APPLE LOCAL LLVM +# LLVM LOCAL libbackend.o : $(OBJS-common:.o=.c) $(out_file) $(out_cxx_file) \ insn-config.h insn-flags.h insn-codes.h insn-constants.h \ insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) @@ -2961,7 +2961,7 @@ -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ -DDEVPHASE=$(DEVPHASE_s) -combine -# APPLE LOCAL LLVM +# LLVM LOCAL endif # @@ -3170,11 +3170,11 @@ $(srcdir)/targhooks.c $(srcdir)/cgraphunit.c $(out_file) \ @all_gtfiles@ -# APPLE LOCAL begin LLVM - Remove gcse.c +# LLVM LOCAL begin - Remove gcse.c ifdef BUILD_LLVM_INTO_A_DYLIB GTFILES := $(filter-out $(srcdir)/gcse.c, $(GTFILES)) endif -# APPLE LOCAL end LLVM - Remove gcse.c +# LLVM LOCAL end - Remove gcse.c GTFILES_FILES_LANGS = @all_gtfiles_files_langs@ GTFILES_FILES_FILES = @all_gtfiles_files_files@ @@ -3388,11 +3388,11 @@ PROTO_OBJS = intl.o version.o cppdefault.o errors.o protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS) - # APPLE LOCAL LLVM + # LLVM LOCAL $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS) unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS) - # APPLE LOCAL LLVM + # LLVM LOCAL $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS) protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) $(SYSTEM_H) \ Modified: llvm-gcc-4-2/trunk/gcc/ada/misc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/ada/misc.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/ada/misc.c (original) +++ llvm-gcc-4-2/trunk/gcc/ada/misc.c Fri Jul 13 03:39:34 2007 @@ -500,9 +500,9 @@ using_eh_for_cleanups (); eh_personality_libfunc = init_one_libfunc ("__gnat_eh_personality"); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ default_init_unwind_resume_libfunc (); - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ lang_eh_type_covers = gnat_eh_type_covers; lang_eh_runtime_type = gnat_eh_runtime_type; default_init_unwind_resume_libfunc (); Modified: llvm-gcc-4-2/trunk/gcc/alias.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/alias.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/alias.c (original) +++ llvm-gcc-4-2/trunk/gcc/alias.c Fri Jul 13 03:39:34 2007 @@ -580,7 +580,7 @@ /* If we've already determined the alias set for a decl, just return it. This is necessary for C++ anonymous unions, whose component variables don't look like union members (boo!). */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM if (TREE_CODE (t) == VAR_DECL && DECL_RTL_SET_P (t) && MEM_P (DECL_RTL (t))) @@ -590,7 +590,7 @@ && DECL_LLVM_SET_P (t)) return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* Now all we care about is the type. */ t = TREE_TYPE (t); Modified: llvm-gcc-4-2/trunk/gcc/autom4te.cache/output.0 URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/autom4te.cache/output.0?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/autom4te.cache/output.0 (original) +++ llvm-gcc-4-2/trunk/gcc/autom4te.cache/output.0 Fri Jul 13 03:39:34 2007 @@ -6540,7 +6540,7 @@ IFS="$ac_save_IFS" nocommon_flag="" -# APPLE LOCAL llvm +# LLVM LOCAL # Expose a flag in the makefile so we can tell when ENABLE_CHECKING is set. checkingenabled_flag="" if test x$ac_checking != x ; then @@ -6550,10 +6550,10 @@ _ACEOF nocommon_flag=-fno-common - # APPLE LOCAL llvm + # LLVM LOCAL checkingenabled_flag=CHECKING_ENABLED=1 fi -# APPLE LOCAL llvm +# LLVM LOCAL if test x$ac_assert_checking != x ; then @@ -7200,7 +7200,7 @@ fi; -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # See if dsymutil has been installed and is modern enough # that we can use DWARF. @@ -7384,7 +7384,7 @@ LLVMBASEPATH="" fi; -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Sanity check enable_languages in case someone does not run the toplevel # configure # script. @@ -12565,7 +12565,7 @@ # Say what files are being used for the output code and MD file. echo "Using \`$srcdir/config/$out_file' for machine-specific logic." -# APPLE LOCAL llvm +# LLVM LOCAL echo "Using \`$srcdir/config/$out_cxx_file' for machine-specific C++ logic." echo "Using \`$srcdir/config/$md_file' as machine description file." @@ -13412,7 +13412,7 @@ out_object_file=`basename $out_file .c`.o -# APPLE LOCAL LLVM +# LLVM LOCAL out_cxx_object_file=`basename $out_cxx_file .cpp`.o tm_file_list="options.h" @@ -16963,10 +16963,10 @@ -# APPLE LOCAL llvm +# LLVM LOCAL -# APPLE LOCAL llvm +# LLVM LOCAL Modified: llvm-gcc-4-2/trunk/gcc/bt-load.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/bt-load.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/bt-load.c (original) +++ llvm-gcc-4-2/trunk/gcc/bt-load.c Fri Jul 13 03:39:34 2007 @@ -1504,11 +1504,11 @@ rest_of_handle_branch_target_load_optimize (void) { static int warned = 0; -/* APPLE LOCAL begin LLVM - reduce cc1 size. */ +/* LLVM LOCAL begin - reduce cc1 size. */ #ifdef ENABLE_LLVM return; #endif -/* APPLE LOCAL end LLVM. */ +/* LLVM LOCAL end. */ /* Leave this a warning for now so that it is possible to experiment with running this pass twice. In 3.6, we should either make this an error, or use separate dump files. */ Modified: llvm-gcc-4-2/trunk/gcc/builtins.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/builtins.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/builtins.c (original) +++ llvm-gcc-4-2/trunk/gcc/builtins.c Fri Jul 13 03:39:34 2007 @@ -71,7 +71,7 @@ required to implement the function call in all cases). */ tree implicit_built_in_decls[(int) END_BUILTINS]; -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ int get_pointer_alignment (tree, unsigned int); static const char *c_getstr (tree); static rtx c_readstr (const char *, enum machine_mode); @@ -140,9 +140,9 @@ static tree fold_builtin_strlen (tree); static tree fold_builtin_inf (tree, int); static tree fold_builtin_nan (tree, tree, int); -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ int validate_arglist (tree, ...); -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ static bool integer_valued_real_p (tree); static tree fold_trunc_transparent_mathfn (tree, tree); static bool readonly_data_expr (tree); @@ -230,7 +230,7 @@ Otherwise, look at the expression to see if we can do better, i.e., if the expression is actually pointing at an object whose alignment is tighter. */ -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ int get_pointer_alignment (tree exp, unsigned int max_align) { @@ -5681,11 +5681,11 @@ enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); enum machine_mode target_mode = TYPE_MODE (TREE_TYPE (exp)); - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) return targetm.expand_builtin (exp, target, subtarget, mode, ignore); @@ -9339,9 +9339,9 @@ of tree_codes. If the last specifier is a 0, that represents an ellipses, otherwise the last specifier must be a VOID_TYPE. */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ int /* export this for LLVM to use*/ -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ validate_arglist (tree arglist, ...) { enum tree_code code; Modified: llvm-gcc-4-2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/c-common.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4-2/trunk/gcc/c-common.c Fri Jul 13 03:39:34 2007 @@ -622,11 +622,11 @@ bool *); static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *); -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM static tree handle_annotate_attribute (tree*, tree, tree, int, bool *); #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ static void check_function_nonnull (tree, tree); static void check_nonnull_arg (void *, tree, unsigned HOST_WIDE_INT); @@ -729,12 +729,12 @@ handle_warn_unused_result_attribute }, { "sentinel", 0, 1, false, true, true, handle_sentinel_attribute }, - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM { "annotate", 0, -1, true, false, false, handle_annotate_attribute }, #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ { NULL, 0, 0, false, false, false, NULL } }; @@ -2489,7 +2489,7 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) { tree size_exp, ret; - /* APPLE LOCAL LLVM */ + /* LLVM LOCAL */ bool size_set = 0; /* The result is a pointer of the same type that is being added. */ @@ -2514,7 +2514,7 @@ pedwarn ("pointer to member function used in arithmetic"); size_exp = integer_one_node; } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ else { size_set = 1; size_exp = size_in_bytes (TREE_TYPE (result_type)); @@ -2548,7 +2548,7 @@ return folded; } #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* We are manipulating pointer values, so we don't need to warn about relying on undefined signed overflow. We disable the @@ -2765,7 +2765,7 @@ && DECL_EXTERNAL (inner)) break; -/* APPLE LOCAL begin llvm */ +/* LLVM LOCAL begin */ #if ENABLE_LLVM /* LLVM extends ARRAY_REF to allow pointers to be the base value. It is not valid to assume ADDR of this is nonzero, because it could be derived from @@ -2775,7 +2775,7 @@ != ARRAY_TYPE) break; #endif -/* APPLE LOCAL end llvm */ +/* LLVM LOCAL end */ if (TREE_SIDE_EFFECTS (inner)) return build2 (COMPOUND_EXPR, truthvalue_type_node, @@ -6033,7 +6033,7 @@ return NULL_TREE; } -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Handle "annotate" attribute */ static tree @@ -6064,7 +6064,7 @@ return NULL_TREE; } #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Check for valid arguments being passed to a function. */ void @@ -6922,9 +6922,9 @@ /* Default value of the constraint table. */ /* ??? This should be in defaults.h or a CW asm specific header. */ #ifndef TARGET_IASM_OP_CONSTRAINT -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #define TARGET_IASM_OP_CONSTRAINT -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #endif /* Comparison function for bsearch to find an opcode/argument number @@ -7004,9 +7004,9 @@ /* This table must be sorted. */ const struct iasm_op_constraint db[] = { TARGET_IASM_OP_CONSTRAINT - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ { "", 0, "" } - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ }; struct iasm_op_constraint key; struct iasm_op_constraint *r; @@ -7018,9 +7018,9 @@ { size_t i; once = 1; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ for (i=0; i < sizeof (db) / sizeof(db[0]) - 2; ++i) - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ gcc_assert (iasm_op_comp (&db[i+1], &db[i]) >= 0); } #endif @@ -7030,9 +7030,9 @@ TARGET_IASM_REORDER_ARG(opcode, key.argnum, num_args, argnum); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ r = bsearch (&key, db, sizeof (db) / sizeof (db[0]) - 1, sizeof (db[0]), iasm_op_comp); - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ IASM_SYNTH_CONSTRAINTS(r, argnum, num_args, db); @@ -7088,13 +7088,13 @@ tree *outputsp, tree *inputsp, tree *uses, unsigned num_args, iasm_md_extra_info *e) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ const char *s = NULL; - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ bool was_output = true; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ tree str = NULL, one; - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ tree var = e->dat[op_num].var; unsigned argnum = e->dat[op_num].argnum; /* must_be_reg is true, iff we know the operand must be a register. */ Modified: llvm-gcc-4-2/trunk/gcc/c-cppbuiltin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/c-cppbuiltin.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/c-cppbuiltin.c (original) +++ llvm-gcc-4-2/trunk/gcc/c-cppbuiltin.c Fri Jul 13 03:39:34 2007 @@ -370,7 +370,7 @@ gcc_assert (!*v || *v == ' ' || *v == '-'); - /* APPLE LOCAL LLVM no version number */ + /* LLVM LOCAL no version number */ #ifndef LLVM_VERSION_INFO /* APPLE LOCAL begin Apple version */ @@ -401,7 +401,7 @@ #endif /* APPLE LOCAL end Apple version */ - /* APPLE LOCAL begin LLVM version number */ + /* LLVM LOCAL begin version number */ #else #ifdef CONFIG_DARWIN_H /* This chunk of code defines __APPLE_CC__ from the version @@ -445,7 +445,7 @@ } #endif /*CONFIG_DARWIN_H*/ #endif /*LLVM_VERSION_INFO*/ - /* APPLE LOCAL end LLVM version number */ + /* LLVM LOCAL end version number */ } /* Define macros used by . Currently only defines limits @@ -475,11 +475,11 @@ define__GNUC__ (); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM cpp_define (pfile, "__llvm__"); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* For stddef.h. They require macros defined in c-common.c. */ c_stddef_cpp_builtins (); Modified: llvm-gcc-4-2/trunk/gcc/c-decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/c-decl.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/c-decl.c (original) +++ llvm-gcc-4-2/trunk/gcc/c-decl.c Fri Jul 13 03:39:34 2007 @@ -61,7 +61,7 @@ #include "except.h" #include "langhooks-def.h" #include "pointer-set.h" -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ #include "llvm.h" /* In grokdeclarator, distinguish syntactic contexts of declarators. */ @@ -2000,7 +2000,7 @@ /* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl so that encode_section_info has a chance to look at the new decl flags and attributes. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM if (DECL_RTL_SET_P (olddecl) && (TREE_CODE (olddecl) == FUNCTION_DECL @@ -7130,7 +7130,7 @@ tree_rest_of_compilation (fndecl); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM if (DECL_STATIC_CONSTRUCTOR (fndecl)) llvm_emit_ctor_dtor (fndecl, DEFAULT_INIT_PRIORITY, 1); @@ -7138,7 +7138,7 @@ llvm_emit_ctor_dtor (fndecl, DEFAULT_INIT_PRIORITY, 0); return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (DECL_STATIC_CONSTRUCTOR (fndecl) && targetm.have_ctors_dtors) Modified: llvm-gcc-4-2/trunk/gcc/c-incpath.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/c-incpath.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/c-incpath.c (original) +++ llvm-gcc-4-2/trunk/gcc/c-incpath.c Fri Jul 13 03:39:34 2007 @@ -233,9 +233,9 @@ /* If it is a regular file and if it is large enough to be a header- map, see if it really is one. */ if (fstat (fileno (f), &f_info) == 0 && S_ISREG(f_info.st_mode) - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ && (unsigned) f_info.st_size >= sizeof(struct hmap_header_map)) - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ { unsigned headermap_size = f_info.st_size; Modified: llvm-gcc-4-2/trunk/gcc/c-lex.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/c-lex.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/c-lex.c (original) +++ llvm-gcc-4-2/trunk/gcc/c-lex.c Fri Jul 13 03:39:34 2007 @@ -766,7 +766,7 @@ return itk_none; } -/* APPLE LOCAL begin llvm hack for PR1521 */ +/* LLVM LOCAL begin hack for PR1521 */ #define PART_PRECISION (sizeof (cpp_num_part) * CHAR_BIT) /* Sign extend a number, with PRECISION significant bits and all others assumed clear, to fill out a cpp_num structure. */ @@ -792,7 +792,7 @@ return num; } -/* APPLE LOCAL llvm end */ +/* LLVM LOCAL end */ /* Interpret TOKEN, an integer with FLAGS as classified by cpplib. */ static tree @@ -804,7 +804,7 @@ cpp_options *options = cpp_get_options (parse_in); integer = cpp_interpret_integer (parse_in, token, flags); - /* APPLE LOCAL llvm hack for PR1521 */ + /* LLVM LOCAL hack for PR1521 */ integer = my_cpp_num_sign_extend (integer, options->precision); /* The type of a constant with a U suffix is straightforward. */ Modified: llvm-gcc-4-2/trunk/gcc/c-pch.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/c-pch.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/c-pch.c (original) +++ llvm-gcc-4-2/trunk/gcc/c-pch.c Fri Jul 13 03:39:34 2007 @@ -34,7 +34,7 @@ #include "langhooks.h" #include "hosthooks.h" #include "target.h" -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #include "llvm.h" /* This is a list of flag variables that must match exactly, and their @@ -181,11 +181,11 @@ long written; struct c_pch_header h; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM llvm_asm_file_end(); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ (*debug_hooks->handle_pch) (1); cpp_write_pch_deps (parse_in, pch_outfile); @@ -393,7 +393,7 @@ if (!flag_preprocess_only) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM unsigned char *buf = xmalloc (h.asm_size); if (fread (buf, h.asm_size, 1, f) != 1) @@ -414,7 +414,7 @@ written += size; } #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ free (buf); } else Modified: llvm-gcc-4-2/trunk/gcc/c-ppoutput.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/c-ppoutput.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/c-ppoutput.c (original) +++ llvm-gcc-4-2/trunk/gcc/c-ppoutput.c Fri Jul 13 03:39:34 2007 @@ -21,7 +21,7 @@ #include "system.h" #include "coretypes.h" #include "tm.h" -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ #include "toplev.h" #include "cpplib.h" #include "../libcpp/internal.h" @@ -455,10 +455,10 @@ { c_common_read_pch (pfile, name, fd, orig_name); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ fprintf (print.outf, "#pragma GCC pch_preprocess "); output_quoted_string (print.outf, name); fprintf (print.outf, "\n"); - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ print.src_line++; } Modified: llvm-gcc-4-2/trunk/gcc/c-typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/c-typeck.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/c-typeck.c (original) +++ llvm-gcc-4-2/trunk/gcc/c-typeck.c Fri Jul 13 03:39:34 2007 @@ -2072,7 +2072,7 @@ gcc_assert (TREE_CODE (TREE_TYPE (ar)) == POINTER_TYPE); gcc_assert (TREE_CODE (TREE_TYPE (TREE_TYPE (ar))) != FUNCTION_TYPE); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Do not create explicit pointer arithmetic for pointer subscripts, * instead, generate an array ref, even though the first argument is a @@ -2086,7 +2086,7 @@ return build4 (ARRAY_REF, ty, ar, index, NULL_TREE, NULL_TREE); } #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ return build_indirect_ref (build_binary_op (PLUS_EXPR, ar, index, 0), "array indexing"); @@ -3183,7 +3183,7 @@ return TREE_OPERAND (arg, 0); } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ /* LLVM wants &x[y] to be kept as an &x[y] for better optimization. */ #ifndef ENABLE_LLVM /* For &x[y], return x+y */ @@ -3199,7 +3199,7 @@ TREE_OPERAND (arg, 1), 1); } #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* Anything not already handled and not a true memory reference or a non-lvalue array is an error. */ @@ -3375,13 +3375,13 @@ case ARRAY_REF: case REALPART_EXPR: case IMAGPART_EXPR: - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM if (TREE_CODE (x) == ARRAY_REF && TREE_CODE (TREE_TYPE (TREE_OPERAND (x, 0))) != ARRAY_TYPE) return true; /* Ignore pointer base of array ref extension. */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ x = TREE_OPERAND (x, 0); break; @@ -7464,7 +7464,7 @@ case ADDR_EXPR: inner = TREE_OPERAND (inner, 0); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ while (REFERENCE_CLASS_P (inner) && TREE_CODE (inner) != INDIRECT_REF) { #ifdef ENABLE_LLVM @@ -7475,7 +7475,7 @@ #endif inner = TREE_OPERAND (inner, 0); } - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (DECL_P (inner) && !DECL_EXTERNAL (inner) Modified: llvm-gcc-4-2/trunk/gcc/cgraph.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cgraph.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cgraph.c (original) +++ llvm-gcc-4-2/trunk/gcc/cgraph.c Fri Jul 13 03:39:34 2007 @@ -261,13 +261,13 @@ historically been doing the wrong thing in assemble_alias by always printing the leading underscore. Since we're not changing that, make sure user_label_prefix follows the '*' before matching. */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM if (IDENTIFIER_POINTER (decl_asmname)[0] == 1) #else if (IDENTIFIER_POINTER (decl_asmname)[0] == '*') #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ { const char *decl_str = IDENTIFIER_POINTER (decl_asmname) + 1; size_t ulp_len = strlen (user_label_prefix); Modified: llvm-gcc-4-2/trunk/gcc/cgraphunit.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cgraphunit.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cgraphunit.c (original) +++ llvm-gcc-4-2/trunk/gcc/cgraphunit.c Fri Jul 13 03:39:34 2007 @@ -166,7 +166,7 @@ #include "tree-gimple.h" #include "tree-pass.h" #include "output.h" -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ #include "llvm.h" static void cgraph_expand_all_functions (void); @@ -1793,12 +1793,12 @@ else cgraph_finalize_function (decl, 0); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM llvm_emit_ctor_dtor (decl, priority, which == 'I'); return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (targetm.have_ctors_dtors) { Modified: llvm-gcc-4-2/trunk/gcc/common.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/common.opt?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/common.opt (original) +++ llvm-gcc-4-2/trunk/gcc/common.opt Fri Jul 13 03:39:34 2007 @@ -214,7 +214,7 @@ Common Separate -dumpbase Set the file basename to be used for dumps -; APPLE LOCAL begin LLVM +; LLVM LOCAL begin ; Emit LLVM assembly to the .s file instead of native code. emit-llvm Common Report Var(emit_llvm) @@ -224,7 +224,7 @@ emit-llvm-bc Common Report Var(emit_llvm_bc) Emit LLVM IR to the output file instead of native machine code. -; APPLE LOCAL end LLVM +; LLVM LOCAL end ; The version of the C++ ABI in use. The following values are allowed: ; @@ -1312,11 +1312,11 @@ Common JoinedOrMissing Negative(gcoff) Generate debug information in extended XCOFF format -; APPLE LOCAL begin LLVM +; LLVM LOCAL begin mllvm Common Separate Report Specify options directly to the LLVM backend -; APPLE LOCAL end LLVM +; LLVM LOCAL end o Common Joined Separate Modified: llvm-gcc-4-2/trunk/gcc/config.gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config.gcc?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config.gcc (original) +++ llvm-gcc-4-2/trunk/gcc/config.gcc Fri Jul 13 03:39:34 2007 @@ -69,12 +69,12 @@ # defining header ${cpu_type}/${cpu_type.h}. # # tm_p_file Location of file with declarations for functions -# APPLE LOCAL LLVM +# LLVM LOCAL # in $out_file & $out_cxx_file # # out_file The name of the machine description C support # file, if different from "$cpu_type/$cpu_type.c". -# APPLE LOCAL LLVM +# LLVM LOCAL # out_cxx_file The name of the machine description C++ support file. # # md_file The name of the machine-description file, if @@ -154,7 +154,7 @@ # system normally uses GNU ld. out_file= -# APPLE LOCAL LLVM +# LLVM LOCAL out_cxx_file= tmake_file= extra_headers= @@ -274,17 +274,17 @@ # APPLE LOCAL begin mainline i[34567]86-*-*) cpu_type=i386 -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin out_cxx_file=i386/llvm-i386.cpp -# APPLE LOCAL end LLVM +# LLVM LOCAL end extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h pmmintrin.h tmmintrin.h" ;; x86_64-*-*) cpu_type=i386 -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin out_cxx_file=i386/llvm-i386.cpp -# APPLE LOCAL end LLVM +# LLVM LOCAL end extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h pmmintrin.h tmmintrin.h" need_64bit_hwint=yes @@ -3097,7 +3097,7 @@ target_cpu_default2="\\\"$with_cpu\\\"" fi out_file=rs6000/rs6000.c - # APPLE LOCAL begin LLVM + # LLVM LOCAL begin out_cxx_file=rs6000/llvm-rs6000.cpp c_target_objs="${c_target_objs} rs6000-c.o" cxx_target_objs="${cxx_target_objs} rs6000-c.o" Modified: llvm-gcc-4-2/trunk/gcc/config/arm/arm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/arm/arm.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/arm/arm.c (original) +++ llvm-gcc-4-2/trunk/gcc/config/arm/arm.c Fri Jul 13 03:39:34 2007 @@ -4903,7 +4903,7 @@ } } -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ /* Values which must be returned in the most-significant end of the return register. */ @@ -4915,7 +4915,7 @@ && (AGGREGATE_TYPE_P (valtype) || TREE_CODE (valtype) == COMPLEX_TYPE)); } -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* RTX cost for cores with a fast multiply unit (M variants). */ @@ -6235,7 +6235,7 @@ return ""; } -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ /* Return true if a type must be passed in memory. For AAPCS, small aggregates (padded to the size of a word) should be passed in a register. */ @@ -6286,7 +6286,7 @@ /* Otherwise, use default padding. */ return !BYTES_BIG_ENDIAN; } -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Routines for use in generating RTL. */ @@ -13042,7 +13042,7 @@ fprintf (f, "}\n"); } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ if (ARM_EABI_UNWIND_TABLES && push) { fprintf (f, "\t.save\t{"); @@ -13057,7 +13057,7 @@ } fprintf (f, "}\n"); } - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ fprintf (f, "\t%s\t{", push ? "push" : "pop"); @@ -14111,10 +14111,10 @@ if (ARM_EABI_UNWIND_TABLES) asm_fprintf (f, "\t.pad #16\n"); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ if (ARM_EABI_UNWIND_TABLES) asm_fprintf (f, "\t.pad #16\n"); - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ asm_fprintf (f, "\tsub\t%r, %r, #16\t%@ Create stack backtrace structure\n", @@ -15145,9 +15145,9 @@ static bool arm_align_anon_bitfield (void) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ return TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX; - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } @@ -15246,13 +15246,13 @@ } -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ static bool arm_cxx_use_aeabi_atexit (void) { return TARGET_AAPCS_BASED; } -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ void arm_set_return_address (rtx source, rtx scratch) Modified: llvm-gcc-4-2/trunk/gcc/config/arm/arm.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/arm/arm.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/arm/arm.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/arm/arm.h Fri Jul 13 03:39:34 2007 @@ -519,11 +519,11 @@ #define PTRDIFF_TYPE (TARGET_AAPCS_BASED ? "int" : "long int") #endif -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef PTRDIFF_TYPE #define PTRDIFF_TYPE (TARGET_AAPCS_BASED ? "int" : "long int") #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* AAPCS requires that structure alignment is affected by bitfields. */ #ifndef PCC_BITFIELD_TYPE_MATTERS @@ -882,9 +882,9 @@ #define DBX_REGISTER_NUMBER(REGNO) arm_dbx_register_number (REGNO) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #define DBX_REGISTER_NUMBER(REGNO) arm_dbx_register_number (REGNO) -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms may be accessed @@ -1482,7 +1482,7 @@ #define PAD_VARARGS_DOWN \ ((TARGET_AAPCS_BASED) ? 0 : BYTES_BIG_ENDIAN) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #define FUNCTION_ARG_PADDING(MODE, TYPE) \ (arm_pad_arg_upward (MODE, TYPE) ? upward : downward) @@ -1493,7 +1493,7 @@ * mimic the default. */ #define PAD_VARARGS_DOWN \ ((TARGET_AAPCS_BASED) ? 0 : BYTES_BIG_ENDIAN) -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. @@ -1918,7 +1918,7 @@ #define ARM_EABI_UNWIND_TABLES 0 #endif -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #define ARM_OUTPUT_FN_UNWIND(F, PROLOGUE) arm_output_fn_unwind (F, PROLOGUE) #ifdef TARGET_UNWIND_INFO @@ -1927,7 +1927,7 @@ #else #define ARM_EABI_UNWIND_TABLES 0 #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. @@ -2630,7 +2630,7 @@ ARM_BUILTIN_MAX }; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #define LLVM_TARGET_INTRINSIC_PREFIX "arm" /* Turn -march=xx into a CPU type. @@ -2685,6 +2685,6 @@ /* Doing struct copy by partial-word loads and stores is not a good idea on ARM. */ #define TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY 4 -/* APPLE LOCAL end llvm */ +/* LLVM LOCAL end */ #endif /* ! GCC_ARM_H */ Modified: llvm-gcc-4-2/trunk/gcc/config/arm/lib1funcs.asm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/arm/lib1funcs.asm?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/arm/lib1funcs.asm (original) +++ llvm-gcc-4-2/trunk/gcc/config/arm/lib1funcs.asm Fri Jul 13 03:39:34 2007 @@ -1306,7 +1306,7 @@ #include "ieee754-df.S" #include "ieee754-sf.S" #include "bpabi.S" -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #include "libunwind.S" -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #endif /* __symbian__ */ Modified: llvm-gcc-4-2/trunk/gcc/config/arm/t-bpabi URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/arm/t-bpabi?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/arm/t-bpabi (original) +++ llvm-gcc-4-2/trunk/gcc/config/arm/t-bpabi Fri Jul 13 03:39:34 2007 @@ -1,8 +1,8 @@ # Add the bpabi.S functions. -#APPLE LOCAL begin LLVM +#LLVM LOCAL begin LIB1ASMFUNCS += _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod \ _unwind -#APPLE LOCAL end LLVM +#LLVM LOCAL end # Add the BPABI C functions. LIB2FUNCS_EXTRA = $(srcdir)/config/arm/bpabi.c \ Modified: llvm-gcc-4-2/trunk/gcc/config/arm/t-symbian URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/arm/t-symbian?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/arm/t-symbian (original) +++ llvm-gcc-4-2/trunk/gcc/config/arm/t-symbian Fri Jul 13 03:39:34 2007 @@ -17,12 +17,12 @@ LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c LIB2ADDEHDEP = $(UNWIND_H) -#APPLE LOCAL begin LLVM +#LLVM LOCAL begin # Include the gcc personality routine UNWIND_H = $(srcdir)/config/arm/unwind-arm.h LIB2ADDEH = $(srcdir)/unwind-c.c LIB2ADDEHDEP = $(UNWIND_H) -#APPLE LOCAL end LLVM +#LLVM LOCAL end # Create a multilib for processors with VFP floating-point, and a # multilib for those without -- using the soft-float ABI in both Modified: llvm-gcc-4-2/trunk/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/darwin.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/darwin.c (original) +++ llvm-gcc-4-2/trunk/gcc/config/darwin.c Fri Jul 13 03:39:34 2007 @@ -1464,7 +1464,7 @@ /* APPLE LOCAL end darwin_set_section_for_var_p */ } -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM const char *darwin_objc_llvm_implicit_target_global_var_section(tree decl) { const char *name; @@ -1540,7 +1540,7 @@ return 0; } #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* This can be called with address expressions as "rtx". They must go in "const". */ Modified: llvm-gcc-4-2/trunk/gcc/config/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/darwin.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/darwin.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/darwin.h Fri Jul 13 03:39:34 2007 @@ -155,7 +155,7 @@ { "-image_base", "-Zimage_base" }, \ { "-init", "-Zinit" }, \ { "-install_name", "-Zinstall_name" }, \ - /* APPLE LOCAL llvm */ \ + /* LLVM LOCAL */ \ { "-mllvm", "-Zmllvm" }, \ { "-mkernel", "-mkernel -static -Wa,-static" }, \ { "-multiply_defined_unused", "-Zmultiplydefinedunused" }, \ @@ -233,7 +233,7 @@ !strcmp (STR, "Zimage_base") ? 1 : \ !strcmp (STR, "Zinit") ? 1 : \ !strcmp (STR, "Zinstall_name") ? 1 : \ - /* APPLE LOCAL llvm */ \ + /* LLVM LOCAL */ \ !strcmp (STR, "Zmllvm") ? 1 : \ !strcmp (STR, "Zmultiplydefinedunused") ? 1 : \ !strcmp (STR, "Zmultiply_defined") ? 1 : \ @@ -290,7 +290,7 @@ #define CC1PLUS_SPEC "-D__private_extern__=extern" /* APPLE LOCAL end private extern */ -/* APPLE LOCAL begin llvm */ +/* LLVM LOCAL begin */ #ifdef HAVE_DSYMUTIL #define DARWIN_DSYMUTIL_SPEC "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %{.c|.cc|.C|.cpp|.c++|.CPP|.m|.mm: \ @@ -298,7 +298,7 @@ #else #define DARWIN_DSYMUTIL_SPEC "" #endif -/* APPLE LOCAL end llvm */ +/* LLVM LOCAL end */ /* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus precomp, libtool, and fat build additions. Also we don't specify a second %G after %L because libSystem is @@ -321,9 +321,9 @@ %{fnested-functions: -allow_stack_execute} \ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %G %L}} \ "/* APPLE LOCAL begin mainline 4.3 2006-10-31 4370146 */"\ -"/* APPLE LOCAL begin llvm */"\ +"/* LLVM LOCAL begin */"\ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}} \n %(darwin_dsymutil) " -/* APPLE LOCAL end llvm */ +/* LLVM LOCAL end */ /* APPLE LOCAL end mainline 4.3 2006-10-31 4370146 */ /* APPLE LOCAL end mainline */ @@ -485,7 +485,7 @@ #define DARWIN_EXTRA_SPECS \ { "darwin_crt1", DARWIN_CRT1_SPEC }, \ { "darwin_dylib1", DARWIN_DYLIB1_SPEC }, \ - /* APPLE LOCAL LLVM */ \ + /* LLVM LOCAL */ \ { "darwin_dsymutil", DARWIN_DSYMUTIL_SPEC }, \ { "darwin_minversion", DARWIN_MINVERSION_SPEC }, @@ -509,7 +509,7 @@ #define DBX_DEBUGGING_INFO 1 -/* APPLE LOCAL begin llvm */ +/* LLVM LOCAL begin */ /* Prefer DWARF only if appropriate dsymutil is available. */ #define DWARF2_DEBUGGING_INFO #ifdef HAVE_DSYMUTIL @@ -517,7 +517,7 @@ #else #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG #endif -/* APPLE LOCAL end llvm */ +/* LLVM LOCAL end */ /* APPLE LOCAL end mainline 4.3 2006-10-31 4370143 */ #define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug" @@ -583,7 +583,7 @@ fputc ('\n', FILE); \ } while (0) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ /* weak_import, a Darwin special, does not make function definitions weak. */ #define TARGET_ADJUST_LLVM_LINKAGE(FN, DECL) \ do { \ @@ -598,7 +598,7 @@ (FN)->setLinkage(Function::ExternalLinkage); \ } \ } while (0) -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Darwin has the pthread routines in libSystem, which every program links to, so there's no need for weak-ness for that. */ @@ -1217,7 +1217,7 @@ /* APPLE LOCAL end iframework for 4.3 4094959 */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION - Given a VAR_DECL for a global * variable, return a "const char*" that indicates which section to put it in if @@ -1242,7 +1242,7 @@ else if (!MACHO_DYNAMIC_NO_PIC_P) \ argvec.push_back ("--relocation-model=static") #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* APPLE LOCAL begin isysroot 5083137 */ /* Allow -sysroot to select a target system SDK. */ Modified: llvm-gcc-4-2/trunk/gcc/config/freebsd-spec.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/freebsd-spec.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/freebsd-spec.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/freebsd-spec.h Fri Jul 13 03:39:34 2007 @@ -48,7 +48,7 @@ || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef ENABLE_LLVM #define FBSD_TARGET_OS_CPP_BUILTINS() \ do \ @@ -87,7 +87,7 @@ } \ while (0) #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Define the default FreeBSD-specific per-CPU hook code. */ #define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0) Modified: llvm-gcc-4-2/trunk/gcc/config/i386/cygming.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/cygming.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/cygming.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/cygming.h Fri Jul 13 03:39:34 2007 @@ -414,7 +414,7 @@ # undef FILE #endif -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* LLVM specific stuff for supporting dllimport & dllexport linkage output */ @@ -431,7 +431,7 @@ /* Add general target specific stuff */ #include "llvm-i386-target.h" -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #endif Modified: llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.4.ver URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.4.ver?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.4.ver (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.4.ver Fri Jul 13 03:39:34 2007 @@ -33,7 +33,7 @@ ___divdc3 ___divdi3 ___divsc3 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___divxc3 ___enable_execute_stack ___ffsdi2 @@ -43,15 +43,15 @@ ___fixunsdfsi ___fixunssfdi ___fixunssfsi -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___fixunsxfdi -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___fixunsxfsi -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___fixxfdi ___floatdidf ___floatdisf -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___floatdixf ___gcc_personality_v0 ___lshrdi3 @@ -61,7 +61,7 @@ ___mulsc3 ___mulvdi3 ___mulvsi3 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___mulxc3 ___negdi2 ___negvdi2 @@ -72,7 +72,7 @@ ___popcountsi2 ___powidf2 ___powisf2 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___powixf2 ___register_frame ___register_frame_info Modified: llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.5.ver URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.5.ver?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.5.ver (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/darwin-libgcc.10.5.ver Fri Jul 13 03:39:34 2007 @@ -34,7 +34,7 @@ ___divdc3 ___divdi3 ___divsc3 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___divxc3 ___enable_execute_stack ___ffsdi2 @@ -61,7 +61,7 @@ ___mulsc3 ___mulvdi3 ___mulvsi3 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___mulxc3 ___negdi2 ___negvdi2 @@ -72,7 +72,7 @@ ___popcountsi2 ___powidf2 ___powisf2 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___powixf2 ___register_frame ___register_frame_info Modified: llvm-gcc-4-2/trunk/gcc/config/i386/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/darwin.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/darwin.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/darwin.h Fri Jul 13 03:39:34 2007 @@ -379,11 +379,11 @@ used in Mach-O. */ #undef MACHO_SYMBOL_FLAG_VARIABLE #define MACHO_SYMBOL_FLAG_VARIABLE ((SYMBOL_FLAG_MACH_DEP) << 3) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Add general target specific stuff */ #include "llvm-i386-target.h" -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #endif Modified: llvm-gcc-4-2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/i386.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/i386.c Fri Jul 13 03:39:34 2007 @@ -15041,9 +15041,9 @@ #endif } -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ /* Move ix86_builtins to i386.h */ -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #define def_builtin(MASK, NAME, TYPE, CODE) \ do { \ if ((MASK) & target_flags \ Modified: llvm-gcc-4-2/trunk/gcc/config/i386/i386.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/i386.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/i386.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/i386.h Fri Jul 13 03:39:34 2007 @@ -506,9 +506,9 @@ builtin_define ("__core2__"); \ } \ /* APPLE LOCAL end mainline */ \ - /* APPLE LOCAL begin LLVM PR879 workaround */ \ + /* LLVM LOCAL begin PR879 workaround */ \ builtin_define("__NO_MATH_INLINES"); \ - /* APPLE LOCAL end LLVM PR879 workaround */ \ + /* LLVM LOCAL end PR879 workaround */ \ } \ while (0) @@ -565,13 +565,13 @@ /* target machine storage layout */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #if defined(ENABLE_LLVM) || defined(__llvm__) #define LONG_DOUBLE_TYPE_SIZE 64 #else #define LONG_DOUBLE_TYPE_SIZE 80 #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Set the value of FLT_EVAL_METHOD in float.h. When using only the FPU, assume that the fpcw is set to extended precision; when using @@ -3216,7 +3216,7 @@ #define SYMBOL_REF_FAR_ADDR_P(X) \ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_FAR_ADDR) != 0) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ /* Codes for all the SSE/MMX builtins. */ enum ix86_builtins @@ -3737,7 +3737,7 @@ #define LLVM_TARGET_INTRINSIC_LOWER(EXP, BUILTIN_CODE, DESTLOC, RESULT, \ DESTTY, OPS) \ TargetIntrinsicLower(EXP, BUILTIN_CODE, DESTLOC, RESULT, DESTTY, OPS); -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Local variables: Modified: llvm-gcc-4-2/trunk/gcc/config/i386/linux.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/linux.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/linux.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/linux.h Fri Jul 13 03:39:34 2007 @@ -192,11 +192,11 @@ /* i386 glibc provides __stack_chk_guard in %gs:0x14. */ #define TARGET_THREAD_SSP_OFFSET 0x14 #endif -+ /* APPLE LOCAL begin LLVM */ ++ /* LLVM LOCAL begin */ + #ifdef ENABLE_LLVM + + /* Add general target specific stuff */ + #include "llvm-i386-target.h" + + #endif -+ /* APPLE LOCAL end LLVM */ ++ /* LLVM LOCAL end */ Modified: llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* Some target-specific hooks for gcc->llvm conversion Copyright (C) 2007 Free Software Foundation, Inc. Contributed by Anton Korobeynikov (asl at math.spbu.ru) @@ -60,5 +60,5 @@ } \ } -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386.cpp?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386.cpp Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* High-level LLVM backend interface Copyright (C) 2005 Free Software Foundation, Inc. Contributed by Evan Cheng (evan.cheng at apple.com) Modified: llvm-gcc-4-2/trunk/gcc/config/ia64/ia64.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/ia64/ia64.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/ia64/ia64.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/ia64/ia64.h Fri Jul 13 03:39:34 2007 @@ -2007,9 +2007,9 @@ #define TARGET_UNWIND_TABLES_DEFAULT true -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #define TARGET_UNWIND_TABLES_DEFAULT true -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM) Modified: llvm-gcc-4-2/trunk/gcc/config/linux.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/linux.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/linux.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/linux.h Fri Jul 13 03:39:34 2007 @@ -126,7 +126,7 @@ is present in the runtime library. */ #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Yes, we're supporting PIC codegen for linux targets! */ @@ -137,5 +137,5 @@ argvec.push_back ("--relocation-model=static"); #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #define TARGET_POSIX_IO Modified: llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-ldouble.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-ldouble.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-ldouble.c (original) +++ llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-ldouble.c Fri Jul 13 03:39:34 2007 @@ -165,11 +165,11 @@ /* Use fused multiply-add to get low part of a * c. */ #ifndef _SOFT_FLOAT -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef __llvm__ /* FIXME: no long double support! */ asm ("fmsub %0,%1,%2,%3" : "=f"(tau) : "f"(a), "f"(c), "f"(t)); #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #else tau = fmsub (a, c, t); #endif @@ -206,11 +206,11 @@ /* Use fused multiply-add to get low part of c * t. */ #ifndef _SOFT_FLOAT -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef __llvm__ /* FIXME: no long double support! */ asm ("fmsub %0,%1,%2,%3" : "=f"(sigma) : "f"(c), "f"(t), "f"(s)); #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #else sigma = fmsub (c, t, s); #endif Modified: llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.4.ver URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.4.ver?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.4.ver (original) +++ llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.4.ver Fri Jul 13 03:39:34 2007 @@ -35,17 +35,17 @@ ___ffsdi2 ___fixdfdi ___fixsfdi -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___fixtfdi ___fixunsdfdi ___fixunsdfsi ___fixunssfdi ___fixunssfsi -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___fixunstfdi ___floatdidf ___floatdisf -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___floatditf ___gcc_personality_v0 ___gcc_qadd Modified: llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.5.ver URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.5.ver?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.5.ver (original) +++ llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin-libgcc.10.5.ver Fri Jul 13 03:39:34 2007 @@ -34,23 +34,23 @@ ___divdc3 ___divdi3 ___divsc3 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___divtc3 ___enable_execute_stack ___ffsdi2 ___fixdfdi ___fixsfdi -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___fixtfdi ___fixunsdfdi ___fixunsdfsi ___fixunssfdi ___fixunssfsi -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___fixunstfdi ___floatdidf ___floatdisf -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___floatditf ___floatundidf ___floatundisf @@ -65,7 +65,7 @@ ___muldc3 ___muldi3 ___mulsc3 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___multc3 ___mulvdi3 ___mulvsi3 @@ -78,7 +78,7 @@ ___popcountsi2 ___powidf2 ___powisf2 -# APPLE LOCAL LLVM FIXME! +# LLVM LOCAL FIXME! #___powitf2 ___register_frame ___register_frame_info Modified: llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/rs6000/darwin.h Fri Jul 13 03:39:34 2007 @@ -95,14 +95,14 @@ consistency; arithmetic will work even if libc and libm support is not available. */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef ENABLE_LLVM #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 #else /* FIXME: no long double support yet! */ #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 64 #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* We want -fPIC by default, unless we're using -static to compile for Modified: llvm-gcc-4-2/trunk/gcc/config/rs6000/llvm-rs6000.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/rs6000/llvm-rs6000.cpp?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/rs6000/llvm-rs6000.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/config/rs6000/llvm-rs6000.cpp Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* High-level LLVM backend interface Copyright (C) 2007 Free Software Foundation, Inc. Contributed by Jim Laskey (jlaskey at apple.com) @@ -331,5 +331,5 @@ return false; } -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.c (original) +++ llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.c Fri Jul 13 03:39:34 2007 @@ -52,11 +52,11 @@ #include "langhooks.h" #include "reload.h" #include "cfglayout.h" -/* APPLE LOCAL begin LLVM - Don't link in scheduler. */ +/* LLVM LOCAL begin - Don't link in scheduler. */ #ifndef ENABLE_LLVM #include "sched-int.h" #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #include "tree-gimple.h" /* APPLE LOCAL 3893112 */ #include "params.h" @@ -151,9 +151,9 @@ /* Target cpu type */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ const char *rs6000_cpu_target = "ppc"; -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ enum processor_type rs6000_cpu; struct rs6000_cpu_select rs6000_select[3] = @@ -676,10 +676,10 @@ static bool rs6000_reverse_bitfields_p (tree); #endif /* APPLE LOCAL end pragma reverse_bitfield */ -/* APPLE LOCAL LLVM - Disable scheduler. */ +/* LLVM LOCAL - Disable scheduler. */ #ifndef ENABLE_LLVM static int rs6000_variable_issue (FILE *, int, rtx, int); -/* APPLE LOCAL LLVM - Disable scheduler. */ +/* LLVM LOCAL - Disable scheduler. */ #endif static bool rs6000_rtx_costs (rtx, int, int, int *); static int rs6000_adjust_cost (rtx, rtx, rtx, int); @@ -687,7 +687,7 @@ static int is_dispatch_slot_restricted (rtx); static bool is_cracked_insn (rtx); static bool is_branch_slot_insn (rtx); -/* APPLE LOCAL LLVM - Disable scheduler. */ +/* LLVM LOCAL - Disable scheduler. */ #ifndef ENABLE_LLVM static int rs6000_adjust_priority (rtx, int); static int rs6000_issue_rate (void); @@ -701,7 +701,7 @@ static void rs6000_sched_finish (FILE *, int); static int rs6000_use_sched_lookahead (void); -/* APPLE LOCAL LLVM - Disable scheduler. */ +/* LLVM LOCAL - Disable scheduler. */ #endif static tree rs6000_builtin_mask_for_load (void); @@ -952,7 +952,7 @@ #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE rs6000_output_function_epilogue -/* APPLE LOCAL LLVM - Disable scheduler. */ +/* LLVM LOCAL - Disable scheduler. */ #ifndef ENABLE_LLVM #undef TARGET_SCHED_VARIABLE_ISSUE #define TARGET_SCHED_VARIABLE_ISSUE rs6000_variable_issue @@ -969,7 +969,7 @@ #define TARGET_SCHED_FINISH rs6000_sched_finish #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD rs6000_use_sched_lookahead -/* APPLE LOCAL LLVM - Disable scheduler. */ +/* LLVM LOCAL - Disable scheduler. */ #endif #undef TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD @@ -1402,9 +1402,9 @@ rs6000_select[0].string = default_cpu; rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ rs6000_cpu_target = TARGET_POWERPC64 ? "ppc64" : "ppc"; - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* APPLE LOCAL begin -fast */ if (flag_fast || flag_fastf || flag_fastcp) @@ -1438,9 +1438,9 @@ mcpu_cpu = processor_target_table[j].processor; /* APPLE LOCAL end -fast */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ rs6000_cpu_target = processor_target_table[j].name; - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } break; } @@ -9076,7 +9076,7 @@ unsigned_V8HI_type_node = build_vector_type (unsigned_intHI_type_node, 8); unsigned_V4SI_type_node = build_vector_type (unsigned_intSI_type_node, 4); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* LLVM doesn't initialize the RTL backend, so build_vector_type will assign all of these types BLKmode. This interferes with rs6000.c-specific @@ -9090,7 +9090,7 @@ TYPE_MODE (unsigned_V8HI_type_node) = V8HImode; TYPE_MODE (unsigned_V16QI_type_node) = V16QImode; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ opaque_V2SF_type_node = build_opaque_vector_type (float_type_node, 2); opaque_V2SI_type_node = build_opaque_vector_type (intSI_type_node, 2); @@ -18761,7 +18761,7 @@ break; } } -/* APPLE LOCAL LLVM - Disable scheduler. */ +/* LLVM LOCAL - Disable scheduler. */ #ifndef ENABLE_LLVM @@ -19676,7 +19676,7 @@ } } -/* APPLE LOCAL LLVM - Disable scheduler. */ +/* LLVM LOCAL - Disable scheduler. */ #endif ENABLE_LLVM /* Length in units of the trampoline for entering a nested function. */ Modified: llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/rs6000/rs6000.h Fri Jul 13 03:39:34 2007 @@ -215,9 +215,9 @@ PROCESSOR_POWER5 }; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ extern const char *rs6000_cpu_target; -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ extern enum processor_type rs6000_cpu; @@ -3419,7 +3419,7 @@ /* APPLE LOCAL end CW asm blocks */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #define LLVM_TARGET_INTRINSIC_PREFIX "ppc" /* Turn -march=xx into a CPU type. @@ -3455,7 +3455,7 @@ DESTTY, OPS) \ TargetIntrinsicLower(EXP, BUILTIN_CODE, DESTLOC, RESULT, DESTTY, OPS); -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ enum rs6000_builtin_type_index { Modified: llvm-gcc-4-2/trunk/gcc/config/rs6000/t-darwin8 URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/rs6000/t-darwin8?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/rs6000/t-darwin8 (original) +++ llvm-gcc-4-2/trunk/gcc/config/rs6000/t-darwin8 Fri Jul 13 03:39:34 2007 @@ -1,7 +1,7 @@ # 64-bit libraries can only be built in Darwin 8.x or later. -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # FIXME: how do I only disable this for llvm? # MULTILIB_OPTIONS = m64 # MULTILIB_DIRNAMES = ppc64 -# APPLE LOCAL end LLVM +# LLVM LOCAL end Modified: llvm-gcc-4-2/trunk/gcc/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/configure?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/configure (original) +++ llvm-gcc-4-2/trunk/gcc/configure Fri Jul 13 03:39:34 2007 @@ -6540,7 +6540,7 @@ IFS="$ac_save_IFS" nocommon_flag="" -# APPLE LOCAL llvm +# LLVM LOCAL # Expose a flag in the makefile so we can tell when ENABLE_CHECKING is set. checkingenabled_flag="" if test x$ac_checking != x ; then @@ -6550,10 +6550,10 @@ _ACEOF nocommon_flag=-fno-common - # APPLE LOCAL llvm + # LLVM LOCAL checkingenabled_flag=CHECKING_ENABLED=1 fi -# APPLE LOCAL llvm +# LLVM LOCAL if test x$ac_assert_checking != x ; then @@ -7200,7 +7200,7 @@ fi; -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # See if dsymutil has been installed and is modern enough # that we can use DWARF. @@ -7384,7 +7384,7 @@ LLVMBASEPATH="" fi; -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Sanity check enable_languages in case someone does not run the toplevel # configure # script. @@ -12565,7 +12565,7 @@ # Say what files are being used for the output code and MD file. echo "Using \`$srcdir/config/$out_file' for machine-specific logic." -# APPLE LOCAL llvm +# LLVM LOCAL echo "Using \`$srcdir/config/$out_cxx_file' for machine-specific C++ logic." echo "Using \`$srcdir/config/$md_file' as machine description file." @@ -13412,7 +13412,7 @@ out_object_file=`basename $out_file .c`.o -# APPLE LOCAL LLVM +# LLVM LOCAL out_cxx_object_file=`basename $out_cxx_file .cpp`.o tm_file_list="options.h" @@ -16963,10 +16963,10 @@ -# APPLE LOCAL llvm +# LLVM LOCAL -# APPLE LOCAL llvm +# LLVM LOCAL Modified: llvm-gcc-4-2/trunk/gcc/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/configure.ac?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/configure.ac (original) +++ llvm-gcc-4-2/trunk/gcc/configure.ac Fri Jul 13 03:39:34 2007 @@ -509,7 +509,7 @@ IFS="$ac_save_IFS" nocommon_flag="" -# APPLE LOCAL llvm +# LLVM LOCAL # Expose a flag in the makefile so we can tell when ENABLE_CHECKING is set. checkingenabled_flag="" if test x$ac_checking != x ; then @@ -517,10 +517,10 @@ [Define if you want more run-time sanity checks. This one gets a grab bag of miscellaneous but relatively cheap checks.]) nocommon_flag=-fno-common - # APPLE LOCAL llvm + # LLVM LOCAL checkingenabled_flag=CHECKING_ENABLED=1 fi -# APPLE LOCAL llvm +# LLVM LOCAL AC_SUBST(checkingenabled_flag) AC_SUBST(nocommon_flag) if test x$ac_assert_checking != x ; then @@ -814,7 +814,7 @@ [onestep=""]) AC_SUBST(onestep) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # See if dsymutil has been installed and is modern enough # that we can use DWARF. gcc_AC_CHECK_PROG_VER(DSYMUTIL, dsymutil, --version, @@ -865,7 +865,7 @@ ], [LLVMBASEPATH=""]) AC_SUBST(LLVMBASEPATH) -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Sanity check enable_languages in case someone does not run the toplevel # configure # script. @@ -1333,7 +1333,7 @@ # Say what files are being used for the output code and MD file. echo "Using \`$srcdir/config/$out_file' for machine-specific logic." -# APPLE LOCAL llvm +# LLVM LOCAL echo "Using \`$srcdir/config/$out_cxx_file' for machine-specific C++ logic." echo "Using \`$srcdir/config/$md_file' as machine description file." @@ -1709,7 +1709,7 @@ AC_SUBST(host_cc_for_libada) out_object_file=`basename $out_file .c`.o -# APPLE LOCAL LLVM +# LLVM LOCAL out_cxx_object_file=`basename $out_cxx_file .cpp`.o tm_file_list="options.h" @@ -3718,10 +3718,10 @@ AC_SUBST(md_file) AC_SUBST(objc_boehm_gc) AC_SUBST(out_file) -# APPLE LOCAL llvm +# LLVM LOCAL AC_SUBST(out_cxx_file) AC_SUBST(out_object_file) -# APPLE LOCAL llvm +# LLVM LOCAL AC_SUBST(out_cxx_object_file) AC_SUBST(stage_prefix_set_by_configure) AC_SUBST(quoted_stage_prefix_set_by_configure) Modified: llvm-gcc-4-2/trunk/gcc/configure.merged URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/configure.merged?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/configure.merged (original) +++ llvm-gcc-4-2/trunk/gcc/configure.merged Fri Jul 13 03:39:34 2007 @@ -6540,7 +6540,7 @@ IFS="$ac_save_IFS" nocommon_flag="" -# APPLE LOCAL llvm +# LLVM LOCAL # Expose a flag in the makefile so we can tell when ENABLE_CHECKING is set. checkingenabled_flag="" if test x$ac_checking != x ; then @@ -6550,10 +6550,10 @@ _ACEOF nocommon_flag=-fno-common - # APPLE LOCAL llvm + # LLVM LOCAL checkingenabled_flag=CHECKING_ENABLED=1 fi -# APPLE LOCAL llvm +# LLVM LOCAL if test x$ac_assert_checking != x ; then @@ -7200,7 +7200,7 @@ fi; -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # See if dsymutil has been installed and is modern enough # that we can use DWARF. # Extract the first word of "dsymutil", so it can be a program name with args. @@ -7380,7 +7380,7 @@ LLVMBASEPATH="" fi; -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Sanity check enable_languages in case someone does not run the toplevel # configure # script. @@ -12563,7 +12563,7 @@ # Say what files are being used for the output code and MD file. echo "Using \`$srcdir/config/$out_file' for machine-specific logic." -# APPLE LOCAL llvm +# LLVM LOCAL echo "Using \`$srcdir/config/$out_cxx_file' for machine-specific C++ logic." echo "Using \`$srcdir/config/$md_file' as machine description file." @@ -13410,7 +13410,7 @@ out_object_file=`basename $out_file .c`.o -# APPLE LOCAL LLVM +# LLVM LOCAL out_cxx_object_file=`basename $out_cxx_file .cpp`.o tm_file_list="options.h" @@ -16919,10 +16919,10 @@ -# APPLE LOCAL llvm +# LLVM LOCAL -# APPLE LOCAL llvm +# LLVM LOCAL Modified: llvm-gcc-4-2/trunk/gcc/cp/Make-lang.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/Make-lang.in?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/Make-lang.in (original) +++ llvm-gcc-4-2/trunk/gcc/cp/Make-lang.in Fri Jul 13 03:39:34 2007 @@ -62,7 +62,7 @@ # Create the compiler driver for g++. GXX_OBJS = $(GCC_OBJS) g++spec.o intl.o prefix.o version.o g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS) - # APPLE LOCAL LLVM + # LLVM LOCAL $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS) @@ -102,7 +102,7 @@ cp-warn = $(STRICT_WARN) $(CXX_COMPAT_WARN) # APPLE LOCAL begin order files --ilr -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) \ @@ -114,12 +114,12 @@ cc1plus-checksum.o : cc1plus-checksum.c -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS) $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) \ $(CC1PLUS_ORDER_FLAGS) -# APPLE LOCAL end LLVM +# LLVM LOCAL end # APPLE LOCAL end order files --ilr # APPLE LOCAL 4133801 cp/parser.o: debug.h Modified: llvm-gcc-4-2/trunk/gcc/cp/class.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/class.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/class.c (original) +++ llvm-gcc-4-2/trunk/gcc/cp/class.c Fri Jul 13 03:39:34 2007 @@ -3879,13 +3879,13 @@ } /* Create the RTL for this function. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (clone, NULL_RTX); #else SET_DECL_LLVM (clone, 0); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ rest_of_decl_compilation (clone, /*top_level=*/1, at_eof); /* Make it easy to find the CLONE given the FN. */ Modified: llvm-gcc-4-2/trunk/gcc/cp/decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/decl.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/decl.c (original) +++ llvm-gcc-4-2/trunk/gcc/cp/decl.c Fri Jul 13 03:39:34 2007 @@ -2079,7 +2079,7 @@ /* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl so that encode_section_info has a chance to look at the new decl flags and attributes. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM if (DECL_RTL_SET_P (olddecl) && (TREE_CODE (olddecl) == FUNCTION_DECL Modified: llvm-gcc-4-2/trunk/gcc/cp/decl2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/decl2.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/decl2.c (original) +++ llvm-gcc-4-2/trunk/gcc/cp/decl2.c Fri Jul 13 03:39:34 2007 @@ -51,7 +51,7 @@ #include "c-pragma.h" #include "tree-dump.h" #include "intl.h" -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ #include "llvm.h" extern cpp_reader *parse_in; @@ -2396,12 +2396,12 @@ if (flag_syntax_only) return; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM llvm_emit_ctor_dtor (fn, initp, method_type == 'I'); return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (targetm.have_ctors_dtors) { Modified: llvm-gcc-4-2/trunk/gcc/cp/lang-specs.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/lang-specs.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/lang-specs.h (original) +++ llvm-gcc-4-2/trunk/gcc/cp/lang-specs.h Fri Jul 13 03:39:34 2007 @@ -55,13 +55,13 @@ %(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\ cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\ - "/* APPLE LOCAL LLVM */"\ + "/* LLVM LOCAL */"\ %(llvm_options) %(cc1_options) %2 %{+e1*}\ %{!fsyntax-only:%(invoke_as)}}}}", CPLUSPLUS_CPP_SPEC, 0, 0}, {".ii", "@c++-cpp-output", 0, 0, 0}, {"@c++-cpp-output", "%{!M:%{!MM:%{!E:\ - "/* APPLE LOCAL LLVM */"\ + "/* LLVM LOCAL */"\ cc1plus -fpreprocessed %i %(llvm_options) %(cc1_options) %2 %{+e*}\ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, Modified: llvm-gcc-4-2/trunk/gcc/cp/method.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/method.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/method.c (original) +++ llvm-gcc-4-2/trunk/gcc/cp/method.c Fri Jul 13 03:39:34 2007 @@ -354,14 +354,14 @@ if (!emit_p) return; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ /* PR843 */ #ifndef ENABLE_LLVM if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function)) #else if (0 && TARGET_USE_LOCAL_THUNK_ALIAS_P (function)) #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ alias = make_alias_for_thunk (function); else alias = function; @@ -401,12 +401,12 @@ push_to_top_level (); if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function) - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ /* PR1085 */ #ifdef ENABLE_LLVM && 0 #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ && targetm.have_named_sections) { resolve_unique_section (function, 0, flag_function_sections); @@ -428,13 +428,13 @@ tree x = copy_node (a); TREE_CHAIN (x) = t; DECL_CONTEXT (x) = thunk_fndecl; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (x, NULL_RTX); #else SET_DECL_LLVM (x, 0); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ DECL_HAS_VALUE_EXPR_P (x) = 0; t = x; } @@ -442,11 +442,11 @@ DECL_ARGUMENTS (thunk_fndecl) = a; if (this_adjusting - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM && 0 /* FIXME: Always use a thunk function */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ && targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset, virtual_value, alias)) { Modified: llvm-gcc-4-2/trunk/gcc/cp/parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/parser.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/parser.c (original) +++ llvm-gcc-4-2/trunk/gcc/cp/parser.c Fri Jul 13 03:39:34 2007 @@ -21590,12 +21590,12 @@ /* Bad parse errors. Just forget about it. */ if (! global_bindings_p () || current_class_type || decl_namespace_list) return; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ if (pch_file) { c_common_write_pch (); return; } - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* APPLE LOCAL end radar 4874613 */ } Modified: llvm-gcc-4-2/trunk/gcc/cp/pt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/pt.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/pt.c (original) +++ llvm-gcc-4-2/trunk/gcc/cp/pt.c Fri Jul 13 03:39:34 2007 @@ -5365,13 +5365,13 @@ later if we need it. */ if (TREE_CODE (new_friend) != TEMPLATE_DECL) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (new_friend, NULL_RTX); #else SET_DECL_LLVM (new_friend, 0); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ SET_DECL_ASSEMBLER_NAME (new_friend, NULL_TREE); } @@ -6681,13 +6681,13 @@ TREE_TYPE (r) = type; /* Clear out the mangled name and RTL for the instantiation. */ SET_DECL_ASSEMBLER_NAME (r, NULL_TREE); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (r, NULL_RTX); #else SET_DECL_LLVM (r, 0); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ DECL_INITIAL (r) = NULL_TREE; DECL_CONTEXT (r) = ctx; @@ -7002,21 +7002,21 @@ cp_apply_type_quals_to_decl (cp_type_quals (type), r); DECL_CONTEXT (r) = ctx; /* Clear out the mangled name and RTL for the instantiation. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (r, NULL_RTX); #else SET_DECL_LLVM (r, 0); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL)) - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (r, NULL_RTX); #else SET_DECL_LLVM (r, 0); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* The initializer must not be expanded until it is required; see [temp.inst]. */ DECL_INITIAL (r) = NULL_TREE; @@ -12320,13 +12320,13 @@ /* Clear out DECL_RTL; whatever was there before may not be right since we've reset the type of the declaration. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (d, NULL_RTX); #else SET_DECL_LLVM (d, 0); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ DECL_IN_AGGR_P (d) = 0; /* The initializer is placed in DECL_INITIAL by Modified: llvm-gcc-4-2/trunk/gcc/cp/typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cp/typeck.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cp/typeck.c (original) +++ llvm-gcc-4-2/trunk/gcc/cp/typeck.c Fri Jul 13 03:39:34 2007 @@ -2539,7 +2539,7 @@ return error_mark_node; } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Do not create explicit pointer arithmetic for pointer subscripts, * instead, generate an array ref, even though the first argument is a @@ -2549,7 +2549,7 @@ return build4 (ARRAY_REF, TREE_TYPE(TREE_TYPE(ar)), ar, ind, NULL_TREE, NULL_TREE); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ return build_indirect_ref (cp_build_binary_op (PLUS_EXPR, ar, ind), "array indexing"); } @@ -4686,13 +4686,13 @@ case ARRAY_REF: case REALPART_EXPR: case IMAGPART_EXPR: - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM if (TREE_CODE (x) == ARRAY_REF && TREE_CODE (TREE_TYPE (TREE_OPERAND (x, 0))) != ARRAY_TYPE) return true; /* Ignore pointer base of array ref extension. */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ x = TREE_OPERAND (x, 0); break; Modified: llvm-gcc-4-2/trunk/gcc/crtstuff.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/crtstuff.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/crtstuff.c (original) +++ llvm-gcc-4-2/trunk/gcc/crtstuff.c Fri Jul 13 03:39:34 2007 @@ -178,25 +178,25 @@ static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_LIST__[1] -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef __llvm__ /* FIXME: Remove when external weak linkage will be alive. */ __attribute__ ((__used__, aligned(sizeof(func_ptr)))) #else __attribute__ ((__unused__, aligned(sizeof(func_ptr)))) #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ = { (func_ptr) (-1) }; #else STATIC func_ptr __CTOR_LIST__[1] -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef __llvm__ /* FIXME: Remove when external weak linkage will be alive. */ __attribute__ ((__used__, section(".ctors"), aligned(sizeof(func_ptr)))) #else __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr)))) #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ = { (func_ptr) (-1) }; #endif /* __CTOR_LIST__ alternatives */ @@ -486,25 +486,25 @@ #elif defined(DTORS_SECTION_ASM_OP) asm (DTORS_SECTION_ASM_OP); STATIC func_ptr __DTOR_END__[1] -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef __llvm__ /* FIXME: Remove when external weak linkage will be alive. */ __attribute__ ((__used__, aligned(sizeof(func_ptr)))) #else __attribute__ ((unused, aligned(sizeof(func_ptr)))) #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ = { (func_ptr) 0 }; #else STATIC func_ptr __DTOR_END__[1] -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef __llvm__ /* FIXME: Remove when external weak linkage will be alive. */ __attribute__((__used__, section(".dtors"), aligned(sizeof(func_ptr)))) #else __attribute__((unused, section(".dtors"), aligned(sizeof(func_ptr)))) #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ = { (func_ptr) 0 }; #endif Modified: llvm-gcc-4-2/trunk/gcc/cse.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/cse.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/cse.c (original) +++ llvm-gcc-4-2/trunk/gcc/cse.c Fri Jul 13 03:39:34 2007 @@ -3691,11 +3691,11 @@ extends. */ enum machine_mode mode_arg0; - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (x == 0) return x; Modified: llvm-gcc-4-2/trunk/gcc/doc/invoke.texi URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/doc/invoke.texi?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/doc/invoke.texi (original) +++ llvm-gcc-4-2/trunk/gcc/doc/invoke.texi Fri Jul 13 03:39:34 2007 @@ -423,7 +423,7 @@ @c APPLE LOCAL lno -fscalar-evolutions -fall-data-deps @gol --param @var{name}=@var{value} - at c APPLE LOCAL -fast, -Oz, llvm + at c LLVM LOCAL -fast, -Oz, -O -O0 -O1 -O2 -O3 -O4 (APPLE ONLY) -Os -Oz (APPLE ONLY) -fast (APPLE ONLY)} @item Preprocessor Options @@ -5066,12 +5066,12 @@ @option{-O2} and also turns on the @option{-finline-functions}, @option{-funswitch-loops} and @option{-fgcse-after-reload} options. - at c APPLE LOCAL begin LLVM + at c LLVM LOCAL begin @item -O4 @opindex O4 Enable LLVM Link Time Optimization. @option{-O4} turns on all LLVM compile time optimizations specified by @option{-O2}. - at c APPLE LOCAL end LLVM + at c LLVM LOCAL end @item -O0 @opindex O0 Modified: llvm-gcc-4-2/trunk/gcc/emit-rtl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/emit-rtl.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/emit-rtl.c (original) +++ llvm-gcc-4-2/trunk/gcc/emit-rtl.c Fri Jul 13 03:39:34 2007 @@ -3111,11 +3111,11 @@ rtx insn_last, insn; int njumps = 0; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (any_condjump_p (trial) && (note = find_reg_note (trial, REG_BR_PROB, 0))) Modified: llvm-gcc-4-2/trunk/gcc/expr.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/expr.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/expr.c (original) +++ llvm-gcc-4-2/trunk/gcc/expr.c Fri Jul 13 03:39:34 2007 @@ -172,14 +172,14 @@ static bool float_extend_from_mem[NUM_MACHINE_MODES][NUM_MACHINE_MODES]; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* LLVM always emits moves with memcpy, which allows us to make smart decisions later. This affects CONSTRUCTOR lowering in the gimplifier. */ #undef MOVE_BY_PIECES_P #define MOVE_BY_PIECES_P(SIZE, ALIGN) (0*(SIZE)*(ALIGN)) #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* This macro is used to determine whether move_by_pieces should be called to perform a structure copy. */ @@ -5771,7 +5771,7 @@ case ARRAY_RANGE_REF: { tree index = TREE_OPERAND (exp, 1); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ tree low_bound, unit_size; #if ENABLE_LLVM /* LLVM extends ARRAY_REF to allow pointers to be the base value. */ @@ -5780,7 +5780,7 @@ #endif low_bound = array_ref_low_bound (exp); unit_size = array_ref_element_size (exp); - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* We assume all arrays have sizes that are a multiple of a byte. First subtract the lower bound, if any, in the type of the @@ -5956,14 +5956,14 @@ case VIEW_CONVERT_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Support the "array ref with pointer base" extension. */ if (TREE_CODE (t) == ARRAY_REF && TREE_CODE (TREE_TYPE (TREE_OPERAND(t, 0))) != ARRAY_TYPE) return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ return 1; default: @@ -6732,11 +6732,11 @@ int rn = -1; rtx ret, last = NULL; - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* Handle ERROR_MARK before anybody tries to access its type. */ if (TREE_CODE (exp) == ERROR_MARK Modified: llvm-gcc-4-2/trunk/gcc/expr.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/expr.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/expr.h (original) +++ llvm-gcc-4-2/trunk/gcc/expr.h Fri Jul 13 03:39:34 2007 @@ -65,13 +65,13 @@ /* If a memory-to-memory move would take MOVE_RATIO or more simple move-instruction sequences, we will do a movmem or libcall instead. */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ /* Disable target-specific hooks for move/clear ratios. */ #ifdef ENABLE_LLVM #undef MOVE_RATIO #undef CLEAR_RATIO #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #ifndef MOVE_RATIO #if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti) Modified: llvm-gcc-4-2/trunk/gcc/final.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/final.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/final.c (original) +++ llvm-gcc-4-2/trunk/gcc/final.c Fri Jul 13 03:39:34 2007 @@ -77,14 +77,14 @@ #include "cgraph.h" #include "coverage.h" -/* APPLE LOCAL begin LLVM - Remove insn-attrtab.o. */ +/* LLVM LOCAL begin - Remove insn-attrtab.o. */ #ifdef ENABLE_LLVM #undef HAVE_ATTR_length int insn_current_reference_address (rtx branch) { return branch == 0; } #endif -/* APPLE LOCAL end LLVM - Remove insn-attrtab.o. */ +/* LLVM LOCAL end - Remove insn-attrtab.o. */ #ifdef XCOFF_DEBUGGING_INFO #include "xcoffout.h" /* Needed for external data Modified: llvm-gcc-4-2/trunk/gcc/flags.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/flags.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/flags.h (original) +++ llvm-gcc-4-2/trunk/gcc/flags.h Fri Jul 13 03:39:34 2007 @@ -388,7 +388,7 @@ /* Whether to emit an overflow warning whose code is C. */ #define issue_strict_overflow_warning(c) (warn_strict_overflow >= (int) (c)) -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ extern int flag_llvm_pch_read; #endif /* ! GCC_FLAGS_H */ Modified: llvm-gcc-4-2/trunk/gcc/fold-const.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/fold-const.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/fold-const.c (original) +++ llvm-gcc-4-2/trunk/gcc/fold-const.c Fri Jul 13 03:39:34 2007 @@ -5218,11 +5218,11 @@ return 0; } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM return 0; /* disable creation of BIT_FIELD_REF, which pessimizes code. */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* After this point all optimizations will generate bit-field references, which we might not want. */ @@ -10789,11 +10789,11 @@ /* If this is a comparison of a field, we may be able to simplify it. */ if (((TREE_CODE (arg0) == COMPONENT_REF - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM && 0/* disable creation of BIT_FIELD_REF, which pessimizes code. */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ && lang_hooks.can_use_bit_fields_p ()) || TREE_CODE (arg0) == BIT_FIELD_REF) /* Handle the constant case even without -O Modified: llvm-gcc-4-2/trunk/gcc/fortran/Make-lang.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/fortran/Make-lang.in?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/fortran/Make-lang.in (original) +++ llvm-gcc-4-2/trunk/gcc/fortran/Make-lang.in Fri Jul 13 03:39:34 2007 @@ -103,7 +103,7 @@ -rm -f gfortran-cross$(exeext) cp gfortran$(exeext) gfortran-cross$(exeext) -# APPLE LOCAL begin llvm +# LLVM LOCAL begin # Language-independent object files. F95_BACKEND = $(BACKEND) attribs.o stub-objc.o stub-c.o @@ -112,7 +112,7 @@ $(F95_BACKEND) $(LIBDEPS) $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(F95_OBJS) $(F95_BACKEND) $(F95_LIBS) -# APPLE LOCAL end llvm +# LLVM LOCAL end gt-fortran-trans.h : s-gtype; @true # Modified: llvm-gcc-4-2/trunk/gcc/fortran/f95-lang.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/fortran/f95-lang.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/fortran/f95-lang.c (original) +++ llvm-gcc-4-2/trunk/gcc/fortran/f95-lang.c Fri Jul 13 03:39:34 2007 @@ -833,13 +833,13 @@ TREE_PUBLIC (decl) = 1; if (library_name) SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name)); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM make_decl_rtl (decl); #else make_decl_llvm (decl); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ pushdecl (decl); DECL_BUILT_IN_CLASS (decl) = class; DECL_FUNCTION_CODE (decl) = function_code; Modified: llvm-gcc-4-2/trunk/gcc/fortran/trans-decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/fortran/trans-decl.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/fortran/trans-decl.c (original) +++ llvm-gcc-4-2/trunk/gcc/fortran/trans-decl.c Fri Jul 13 03:39:34 2007 @@ -1551,13 +1551,13 @@ } /* Create RTL for function definition. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM make_decl_rtl (fndecl); #else make_decl_llvm (fndecl); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ init_function_start (fndecl); @@ -3317,13 +3317,13 @@ rest_of_decl_compilation (fndecl, 1, 0); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM make_decl_rtl (fndecl); #else make_decl_llvm (fndecl); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ init_function_start (fndecl); Modified: llvm-gcc-4-2/trunk/gcc/function.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/function.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/function.c (original) +++ llvm-gcc-4-2/trunk/gcc/function.c Fri Jul 13 03:39:34 2007 @@ -3901,11 +3901,11 @@ cfun = DECL_STRUCT_FUNCTION (fndecl); else allocate_struct_function (fndecl); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ init_emit (); init_varasm_status (cfun); init_expr (); @@ -3953,9 +3953,9 @@ cfun->iasm_noreturn = DECL_IASM_NORETURN (subr); cfun->iasm_frame_size = DECL_IASM_FRAME_SIZE (subr); } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* APPLE LOCAL end CW asm blocks */ /* Prevent ever trying to delete the first instruction of a function. Also tell final how to output a linenum before the @@ -3968,9 +3968,9 @@ This makes sure the first insn will never be deleted. Also, final expects a note to appear there. */ emit_note (NOTE_INSN_DELETED); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* Warn if this value is an aggregate type, regardless of which calling convention we are using for it. */ if (AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr)))) Modified: llvm-gcc-4-2/trunk/gcc/gcc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/gcc.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/gcc.c (original) +++ llvm-gcc-4-2/trunk/gcc/gcc.c Fri Jul 13 03:39:34 2007 @@ -822,7 +822,7 @@ output will be used by another program. */ static const char *cpp_debug_options = "%{d*}"; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ static const char *llvm_options = #ifdef ENABLE_LLVM "%{O4|emit-llvm:%{S:-emit-llvm} \ @@ -833,7 +833,7 @@ "%{emit-llvm:%e--emit-llvm is not supported in this configuration.}" #endif ; -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* NB: This is shared amongst all front-ends. */ static const char *cc1_options = /* APPLE LOCAL begin -fast */ @@ -842,7 +842,7 @@ %{fastcp:-O3}" /* APPLE LOCAL end -fast */ "%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ -"/* APPLE LOCAL llvm */"\ +"/* LLVM LOCAL */"\ %1 %{!Q:-quiet} -dumpbase %B %{d*} %{Zmllvm*: -mllvm %*} %{m*} %{a*}\ %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\ %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\ @@ -859,10 +859,10 @@ static const char *invoke_as = #ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ "%{!O4:%{!emit-llvm:%{!S:-o %|.s |\n as %(asm_options) %|.s %A }}}"; #else -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ "%{!O4:%{!emit-llvm:%{!S:-o %|.s |\n as %(asm_options) %m.s %A }}}"; #endif @@ -1009,17 +1009,17 @@ %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ %(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i}}\ %{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\ - "/* APPLE LOCAL LLVM */"\ + "/* LLVM LOCAL */"\ cc1 %(cpp_unique_options) %(llvm_options) %(cc1_options)}}\ %{!fsyntax-only:%(invoke_as)}};:\ %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ %(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\ "/* APPLE LOCAL predictive compilation */"\ cc1 -fpreprocessed %current_bind_expr); gimplify_ctxp = c->prev_context; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM /* LLVM wants to know about gimple formal temps. */ for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t)) @@ -184,7 +184,7 @@ #else t = 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (body) declare_vars (c->temps, body, false); @@ -546,13 +546,13 @@ block, which means it will go into memory, causing much extra work in reload and final and poorer code generation, outweighing the extra memory allocation here. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM if (1) /* LLVM wants temporaries created in SSA form, never reuse one. */ #else if (!optimize || !is_formal || TREE_SIDE_EFFECTS (val)) #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ ret = create_tmp_from_val (val); else { @@ -1809,11 +1809,11 @@ /* Gimplify the low bound and element type size and put them into the ARRAY_REF. If these values are set, they have already been gimplified. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ /* Handle the LLVM extension that allows: (ARRAY_REF ptr, idx) */ if (!TREE_OPERAND (t, 2) && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == ARRAY_TYPE) - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ { tree low = unshare_expr (array_ref_low_bound (t)); if (!is_gimple_min_invariant (low)) @@ -1825,11 +1825,11 @@ } } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ /* Handle the LLVM extension that allows: (ARRAY_REF ptr, idx) */ if (!TREE_OPERAND (t, 3) && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == ARRAY_TYPE) - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ { tree elmt_type = TREE_TYPE (TREE_TYPE (TREE_OPERAND (t, 0))); tree elmt_size = unshare_expr (array_ref_element_size (t)); @@ -5518,14 +5518,14 @@ break; case ARRAY_REF: - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Handle the LLVM "ARRAY_REF with pointer base" extension by treating pointer-based ARRAY_REFs as binary expressions. */ if (TREE_CODE (TREE_TYPE (TREE_OPERAND (*expr_p, 0))) != ARRAY_TYPE) goto expr_2; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ case ARRAY_RANGE_REF: case REALPART_EXPR: Modified: llvm-gcc-4-2/trunk/gcc/global.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/global.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/global.c (original) +++ llvm-gcc-4-2/trunk/gcc/global.c Fri Jul 13 03:39:34 2007 @@ -435,11 +435,11 @@ size_t i; rtx x; - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ make_accurate_live_analysis (); @@ -1451,11 +1451,11 @@ : reg_preferred_class (allocno[num].reg)); enum machine_mode mode = PSEUDO_REGNO_MODE (allocno[num].reg); - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (accept_call_clobbered) COPY_HARD_REG_SET (used1, call_fixed_reg_set); @@ -1852,11 +1852,11 @@ { int alloc_no = reg_allocno[regno]; - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (alloc_no >= 0) { /* If we have more than one register class, Modified: llvm-gcc-4-2/trunk/gcc/java/Make-lang.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/java/Make-lang.in?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/java/Make-lang.in (original) +++ llvm-gcc-4-2/trunk/gcc/java/Make-lang.in Fri Jul 13 03:39:34 2007 @@ -135,7 +135,7 @@ java/parse-scan.o-warn = -Wno-error java/parse.o-warn = -Wno-error -# APPLE LOCAL begin llvm +# LLVM LOCAL begin # Language-independent object files. JAVA_BACKEND = $(BACKEND) attribs.o stub-objc.o stub-c.o @@ -143,7 +143,7 @@ rm -f $@ $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(JAVA_OBJS) $(JAVA_BACKEND) $(ZLIB) $(LIBICONV) $(LIBS) -# APPLE LOCAL end llvm +# LLVM LOCAL end gcjh$(exeext): $(GCJH_OBJS) $(LIBDEPS) rm -f $@ Modified: llvm-gcc-4-2/trunk/gcc/libgcc2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/libgcc2.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/libgcc2.c (original) +++ llvm-gcc-4-2/trunk/gcc/libgcc2.c Fri Jul 13 03:39:34 2007 @@ -1815,12 +1815,12 @@ extern void *compile_type_assert[sizeof(INFINITY) == sizeof(MTYPE) ? 1 : -1]; /* Ensure that we've lost any extra precision. */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #if defined(__llvm__) #undef NOTRUNC #define NOTRUNC 1 #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #if NOTRUNC # define TRUNC(x) #else Modified: llvm-gcc-4-2/trunk/gcc/llvm-abi.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-abi.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-abi.h Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* Processor ABI customization hooks Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) @@ -338,4 +338,4 @@ #endif #endif -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-backend.cpp?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-backend.cpp Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* High-level LLVM backend interface Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) @@ -1195,4 +1195,4 @@ WriteTypeSymbolic(FS, (const Type*)LLVM, TheModule); } -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* High-level LLVM backend interface Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) @@ -6045,5 +6045,5 @@ return FieldPtr; } -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-debug.cpp?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-debug.cpp Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* High-level LLVM backend interface Copyright (C) 2005 Free Software Foundation, Inc. Contributed by Jim Laskey (jlaskey at apple.com) @@ -880,5 +880,5 @@ } -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/llvm-debug.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-debug.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-debug.h (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-debug.h Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* Internal interfaces between the LLVM backend components Copyright (C) 2006 Free Software Foundation, Inc. Contributed by Jim Laskey (jlaskey at apple.com) @@ -129,4 +129,4 @@ } // end namespace llvm #endif -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/llvm-file-ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-file-ostream.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-file-ostream.h (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-file-ostream.h Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* Definition of the oFILEstream class Copyright (C) 2005 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) Modified: llvm-gcc-4-2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-internal.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-internal.h Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* Internal interfaces between the LLVM backend components Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) @@ -617,4 +617,4 @@ }; #endif -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/llvm-linker-hack.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-linker-hack.cpp?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-linker-hack.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-linker-hack.cpp Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* LLVM Library Link Hack Copyright (C) 2005 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) @@ -82,4 +82,4 @@ llvm::createStripDeadPrototypesPass(); } -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-types.cpp?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-types.cpp Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* Tree type to LLVM type converter Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) @@ -1853,5 +1853,5 @@ return GET_TYPE_LLVM(type); } -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/llvm.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm.h (original) +++ llvm-gcc-4-2/trunk/gcc/llvm.h Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL begin (ENTIRE FILE!) */ /* LLVM interface to GCC Copyright (C) 2005 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) @@ -104,4 +104,4 @@ #endif /* ENABLE_LLVM */ #endif -/* APPLE LOCAL end LLVM (ENTIRE FILE!) */ +/* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4-2/trunk/gcc/longlong.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/longlong.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/longlong.h (original) +++ llvm-gcc-4-2/trunk/gcc/longlong.h Fri Jul 13 03:39:34 2007 @@ -96,9 +96,9 @@ for the CPUs below! (E.g. WE32100, IBM360.) */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #if defined (__GNUC__) && !defined (NO_ASM) && !defined (__llvm__) -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* We sometimes need to clobber "cc" with gcc2, but that would not be understood by gcc1. Use cpp to avoid major code duplication. */ Modified: llvm-gcc-4-2/trunk/gcc/objc/Make-lang.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/objc/Make-lang.in?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/objc/Make-lang.in (original) +++ llvm-gcc-4-2/trunk/gcc/objc/Make-lang.in Fri Jul 13 03:39:34 2007 @@ -60,7 +60,7 @@ # APPLE LOCAL begin order files --ilr cc1obj-dummy$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) - # APPLE LOCAL LLVM + # LLVM LOCAL $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o \ $(BACKEND) $(LIBS) $(CC1OBJ_ORDER_FLAGS) @@ -71,7 +71,7 @@ cc1obj-checksum.o : cc1obj-checksum.c cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o $(BACKEND) $(LIBDEPS) - # APPLE LOCAL LLVM + # LLVM LOCAL $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o \ $(BACKEND) $(LIBS) $(CC1OBJ_ORDER_FLAGS) Modified: llvm-gcc-4-2/trunk/gcc/objc/config-lang.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/objc/config-lang.in?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/objc/config-lang.in (original) +++ llvm-gcc-4-2/trunk/gcc/objc/config-lang.in Fri Jul 13 03:39:34 2007 @@ -32,10 +32,10 @@ stagestuff="cc1obj\$(exeext)" -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # Do not comment target_libs setting target_libs=target-libobjc -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Most of the object files for cc1obj actually come from C. lang_requires="c" Modified: llvm-gcc-4-2/trunk/gcc/objc/lang-specs.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/objc/lang-specs.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/objc/lang-specs.h (original) +++ llvm-gcc-4-2/trunk/gcc/objc/lang-specs.h Fri Jul 13 03:39:34 2007 @@ -30,15 +30,15 @@ %{traditional|ftraditional|traditional-cpp:\ %eGNU Objective C no longer supports traditional compilation}\ %{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\ - "/* APPLE LOCAL LLVM */" \ + "/* LLVM LOCAL */" \ cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(llvm_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\ %{!save-temps:%{!no-integrated-cpp:\ - "/* APPLE LOCAL LLVM */" \ + "/* LLVM LOCAL */" \ cc1obj %(cpp_unique_options) %(llvm_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, {".mi", "@objc-cpp-output", 0, 0, 0}, {"@objc-cpp-output", - /* APPLE LOCAL LLVM */ + /* LLVM LOCAL */ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(llvm_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, {"@objective-c-header", Modified: llvm-gcc-4-2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/objc/objc-act.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4-2/trunk/gcc/objc/objc-act.c Fri Jul 13 03:39:34 2007 @@ -3637,7 +3637,7 @@ static tree start_var_decl (tree type, const char *name) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ tree var = NULL_TREE; #ifdef ENABLE_LLVM /* Darwin linker prefers to use 'L' as a prefix. GCC codegen handles this @@ -3656,7 +3656,7 @@ /* Fall through. Build using 'name' */ #endif var = build_decl (VAR_DECL, get_identifier (name), type); - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ objc_set_global_decl_fields (var); return var; @@ -4124,7 +4124,7 @@ /* APPLE LOCAL begin radar 4590221 */ if (OFFS_MSGSEND_FAST) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM tree umsg_fast_decl; umsg_fast_decl = build_int_cst (NULL_TREE, OFFS_MSGSEND_FAST); @@ -4142,7 +4142,7 @@ build_int_cst (NULL_TREE, OFFS_MSGSEND_FAST), NULL_TREE); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } /* APPLE LOCAL end radar 4590221 */ @@ -5854,7 +5854,7 @@ else if (section == prop_names_attr) sprintf (buf, "_OBJC_PROP_NAME_ATTR_%d", property_name_attr_idx++); /* APPLE LOCAL end C* property metadata (Radar 4498373) */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM { /* Darwin linker prefers to use 'L' as a prefix. GCC codegen handles this @@ -5867,7 +5867,7 @@ #else ident = get_identifier (buf); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ decl = build_decl (VAR_DECL, ident, build_array_type (char_type_node, 0)); @@ -5881,7 +5881,7 @@ DECL_THIS_STATIC (decl) = 1; /* squash redeclaration errors */ #endif - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM make_decl_rtl (decl); #else @@ -5892,7 +5892,7 @@ DECL_PRESERVE_P (decl) = 1; make_decl_llvm (decl); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ pushdecl_top_level (decl); return decl; @@ -8007,7 +8007,7 @@ /* APPLE LOCAL begin radar 4590221 */ if (OFFS_ASSIGNIVAR_FAST) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM tree objc_assign_ivar_fast_decl; objc_assign_ivar_decl @@ -8029,7 +8029,7 @@ build_int_cst (NULL_TREE, OFFS_ASSIGNIVAR_FAST), NULL_TREE); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } else { @@ -8930,11 +8930,11 @@ /* APPLE LOCAL radar 4695109 */ UOBJC_PROTOCOL_EXT_decl, NULL_TREE); /* APPLE LOCAL end radar 4585769 - Objective-C 1.0 extensions */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ /* Force 4 byte alignment for protocols */ DECL_ALIGN(decl) = 32; DECL_USER_ALIGN(decl) = 1; - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ finish_var_decl (decl, initlist); } } @@ -17529,7 +17529,7 @@ } warn_missing_braces = save_warn_missing_braces; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM { int i; @@ -17539,7 +17539,7 @@ DECL_PRESERVE_P (objc_global_trees[i]) = 1; } #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } /* Subroutines of finish_objc. */ @@ -17569,11 +17569,11 @@ tree decl; tree exp; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM #undef ASM_DECLARE_UNRESOLVED_REFERENCE #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ sprintf (string, "%sobjc_class_name_%s", (flag_next_runtime ? "." : "__"), name); @@ -17590,7 +17590,7 @@ decl = build_decl (VAR_DECL, get_identifier (string), char_type_node); DECL_EXTERNAL (decl) = 1; TREE_PUBLIC (decl) = 1; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* This decl's name is special. Ask llvm to not add leading underscore by setting it as a user supplied asm name. */ @@ -17598,7 +17598,7 @@ /* Let optimizer know that this decl is not removable. */ DECL_PRESERVE_P (decl) = 1; #endif ENABLE_LLVM - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ pushdecl (decl); rest_of_decl_compilation (decl, 0, 0); @@ -17611,13 +17611,13 @@ DECL_INITIAL (decl) = exp; TREE_STATIC (decl) = 1; TREE_USED (decl) = 1; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* This decl's name is special. Ask llvm to not add leading underscore by setting it as a user supplied asm name. */ set_user_assembler_name(decl, string); #endif ENABLE_LLVM -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Force the output of the decl as this forces the reference of the class. */ mark_decl_referenced (decl); @@ -17656,7 +17656,7 @@ /* Do the same for categories. Even though no references to these symbols are generated automatically by the compiler, it gives you a handle to pull them into an archive by hand. */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* The * is a sentinel for gcc's back end, but is not wanted by llvm. */ sprintf (string, "%sobjc_category_name_%s_%s", @@ -17665,16 +17665,16 @@ sprintf (string, "*%sobjc_category_name_%s_%s", (flag_next_runtime ? "." : "__"), class_name, class_super_name); #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ } else return; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM #undef ASM_DECLARE_CLASS_REFERENCE #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ #ifdef ASM_DECLARE_CLASS_REFERENCE if (flag_next_runtime) @@ -17695,13 +17695,13 @@ TREE_CONSTANT (decl) = 1; DECL_CONTEXT (decl) = 0; DECL_ARTIFICIAL (decl) = 1; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM set_user_assembler_name(decl, string); /* Let optimizer know that this decl is not removable. */ DECL_PRESERVE_P (decl) = 1; #endif ENABLE_LLVM - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ DECL_INITIAL (decl) = init; assemble_variable (decl, 1, 0, 0); } Modified: llvm-gcc-4-2/trunk/gcc/objcp/Make-lang.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/objcp/Make-lang.in?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/objcp/Make-lang.in (original) +++ llvm-gcc-4-2/trunk/gcc/objcp/Make-lang.in Fri Jul 13 03:39:34 2007 @@ -63,7 +63,7 @@ # APPLE LOCAL begin order files --ilr cc1objplus-dummy$(exeext): $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) \ $(LIBDEPS) - # APPLE LOCAL LLVM + # LLVM LOCAL $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) \ $(CC1OBJPLUS_ORDER_FLAGS) @@ -74,7 +74,7 @@ cc1objplus-checksum.o : cc1objplus-checksum.c cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS) - # APPLE LOCAL LLVM + # LLVM LOCAL $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBS) \ $(CC1OBJPLUS_ORDER_FLAGS) Modified: llvm-gcc-4-2/trunk/gcc/objcp/lang-specs.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/objcp/lang-specs.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/objcp/lang-specs.h (original) +++ llvm-gcc-4-2/trunk/gcc/objcp/lang-specs.h Fri Jul 13 03:39:34 2007 @@ -47,18 +47,18 @@ %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\ cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\ - "/* APPLE LOCAL LLVM */" \ + "/* LLVM LOCAL */" \ %(llvm_options) %(cc1_options) %2 %{+e1*}\ %{!fsyntax-only:%(invoke_as)}}}}", CPLUSPLUS_CPP_SPEC, 0, 0}, {".mii", "@objective-c++-cpp-output", 0, 0, 0}, {"@objective-c++-cpp-output", "%{!M:%{!MM:%{!E:\ - "/* APPLE LOCAL LLVM */" \ + "/* LLVM LOCAL */" \ cc1objplus -fpreprocessed %i %(llvm_options) %(cc1_options) %2 %{+e*}\ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, {"@objc++-cpp-output", "%{!M:%{!MM:%{!E:\ - "/* APPLE LOCAL LLVM */" \ + "/* LLVM LOCAL */" \ cc1objplus -fpreprocessed %i %(llvm_options) %(cc1_options) %2 %{+e*}\ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, Modified: llvm-gcc-4-2/trunk/gcc/optabs.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/optabs.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/optabs.c (original) +++ llvm-gcc-4-2/trunk/gcc/optabs.c Fri Jul 13 03:39:34 2007 @@ -3415,11 +3415,11 @@ rtx final_dest = target; rtx prev, next, first, last, insn; - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* If this is a reg with REG_USERVAR_P set, then it could possibly turn into a MEM later. Protect the libcall block from this change. */ @@ -5144,13 +5144,13 @@ a function. Pretend this is "int foo()". */ tree decl; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM return NULL_RTX; #endif decl = build_decl (FUNCTION_DECL, get_identifier (name), build_function_type (integer_type_node, NULL_TREE)); - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ DECL_ARTIFICIAL (decl) = 1; DECL_EXTERNAL (decl) = 1; Modified: llvm-gcc-4-2/trunk/gcc/opts.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/opts.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/opts.c (original) +++ llvm-gcc-4-2/trunk/gcc/opts.c Fri Jul 13 03:39:34 2007 @@ -520,11 +520,11 @@ /* PRE tends to generate bigger code. */ flag_tree_pre = 1; } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ /* Enable loop unrolling at -O2 if -f[no-]unroll-loops is not used. */ if (!flag_unroll_loops_set && !optimize_size) flag_unroll_loops = 1; - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } if (optimize >= 3) @@ -894,11 +894,11 @@ aux_base_name = arg; break; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ case OPT_mllvm: llvm_optns = arg; break; - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ case OPT_auxbase_strip: { Modified: llvm-gcc-4-2/trunk/gcc/passes.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/passes.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/passes.c (original) +++ llvm-gcc-4-2/trunk/gcc/passes.c Fri Jul 13 03:39:34 2007 @@ -82,7 +82,7 @@ #include "tree-flow.h" #include "tree-pass.h" #include "tree-dump.h" -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #include "llvm.h" #ifdef ENABLE_LLVM @@ -90,7 +90,7 @@ in. */ #undef INSN_SCHEDULING #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ @@ -149,13 +149,13 @@ /* Can't defer this, because it needs to happen before any later function definitions are processed. */ if (DECL_ASSEMBLER_NAME_SET_P (decl) && DECL_REGISTER (decl)) - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM make_decl_rtl (decl); #else make_decl_llvm (decl); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* Forward declarations for nested functions are not "external", but we need to treat them as if they were. */ @@ -196,7 +196,7 @@ information machinery when there are errors. */ && !(sorrycount || errorcount)) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM timevar_push (TV_SYMOUT); debug_hooks->type_decl (decl, !top_level); @@ -204,7 +204,7 @@ #else llvm_emit_typedef (decl); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } /* Let cgraph know about the existence of variables. */ @@ -222,7 +222,7 @@ if (errorcount != 0 || sorrycount != 0) return; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM timevar_push (TV_SYMOUT); debug_hooks->type_decl (TYPE_STUB_DECL (type), !toplev); @@ -231,7 +231,7 @@ llvm_emit_typedef (TYPE_STUB_DECL (type)); toplev = toplev; /* avoid unused var warning */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } @@ -243,11 +243,11 @@ struct dump_file_info *dfi; char *name; - /* APPLE LOCAL begin LLVM Dead code strip cc1. */ + /* LLVM LOCAL begin Dead code strip cc1. */ #ifdef ENABLE_LLVM return; #endif - /* APPLE LOCAL end LLVM Dead code strip cc1. */ + /* LLVM LOCAL end Dead code strip cc1. */ timevar_push (TV_DUMP); if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities) Modified: llvm-gcc-4-2/trunk/gcc/print-tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/print-tree.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/print-tree.c (original) +++ llvm-gcc-4-2/trunk/gcc/print-tree.c Fri Jul 13 03:39:34 2007 @@ -29,9 +29,9 @@ #include "ggc.h" #include "langhooks.h" #include "tree-iterator.h" -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #include "llvm.h" -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Define the hash table of nodes already seen. Such nodes are not repeated; brief cross-references are used. */ @@ -508,7 +508,7 @@ lang_hooks.print_decl (file, node, indent); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM if (DECL_LLVM_SET_P (node)) { @@ -522,7 +522,7 @@ print_rtl (file, DECL_RTL (node)); } #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (TREE_CODE (node) == PARM_DECL) { @@ -664,7 +664,7 @@ lang_hooks.print_type (file, node, indent); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM if (GET_TYPE_LLVM (node)) { @@ -672,7 +672,7 @@ print_llvm_type (file, GET_TYPE_LLVM (node)); } #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (TYPE_POINTER_TO (node) || TREE_CHAIN (node)) indent_to (file, indent + 3); Modified: llvm-gcc-4-2/trunk/gcc/recog.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/recog.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/recog.c (original) +++ llvm-gcc-4-2/trunk/gcc/recog.c Fri Jul 13 03:39:34 2007 @@ -2027,11 +2027,11 @@ int noperands; rtx body = PATTERN (insn); - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ recog_data.insn = NULL; recog_data.n_operands = 0; Modified: llvm-gcc-4-2/trunk/gcc/reload1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/reload1.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/reload1.c (original) +++ llvm-gcc-4-2/trunk/gcc/reload1.c Fri Jul 13 03:39:34 2007 @@ -659,11 +659,11 @@ struct elim_table *ep; basic_block bb; - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* APPLE LOCAL begin 4321079 */ from_global = global; Modified: llvm-gcc-4-2/trunk/gcc/simplify-rtx.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/simplify-rtx.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/simplify-rtx.c (original) +++ llvm-gcc-4-2/trunk/gcc/simplify-rtx.c Fri Jul 13 03:39:34 2007 @@ -4838,11 +4838,11 @@ enum rtx_code code = GET_CODE (x); enum machine_mode mode = GET_MODE (x); - /* APPLE LOCAL begin LLVM - cc1 code size. */ + /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM return 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ switch (GET_RTX_CLASS (code)) { Modified: llvm-gcc-4-2/trunk/gcc/stor-layout.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/stor-layout.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/stor-layout.c (original) +++ llvm-gcc-4-2/trunk/gcc/stor-layout.c Fri Jul 13 03:39:34 2007 @@ -313,11 +313,11 @@ gcc_assert (code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL || code == TYPE_DECL ||code == FIELD_DECL); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM rtl = DECL_RTL_IF_SET (decl); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (type == error_mark_node) type = void_type_node; @@ -513,13 +513,13 @@ DECL_MODE (decl) = VOIDmode; if (!DECL_USER_ALIGN (decl)) DECL_ALIGN (decl) = 0; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (decl, 0); #else SET_DECL_LLVM (decl, 0); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ layout_decl (decl, 0); } Modified: llvm-gcc-4-2/trunk/gcc/stub-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/stub-c.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/stub-c.c (original) +++ llvm-gcc-4-2/trunk/gcc/stub-c.c Fri Jul 13 03:39:34 2007 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file llvm */ +/* LLVM LOCAL file */ /* Stub functions for C language routines that are referenced from the back-end. Copyright (C) 2007 Free Software Foundation, Inc. Modified: llvm-gcc-4-2/trunk/gcc/system.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/system.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/system.h (original) +++ llvm-gcc-4-2/trunk/gcc/system.h Fri Jul 13 03:39:34 2007 @@ -602,7 +602,7 @@ # undef true # undef false -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* For LLVM, we really do want to use the system bool. Because parts of the * compiler are written in C++ and parts are written in C, the two conceptions @@ -613,7 +613,7 @@ #else # define bool unsigned char #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ # define true 1 # define false 0 Modified: llvm-gcc-4-2/trunk/gcc/target-def.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/target-def.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/target-def.h (original) +++ llvm-gcc-4-2/trunk/gcc/target-def.h Fri Jul 13 03:39:34 2007 @@ -84,11 +84,11 @@ #define TARGET_ASM_TTYPE hook_bool_rtx_false #endif -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef TARGET_ARM_TTYPE #define TARGET_ASM_TTYPE hook_bool_rtx_false #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #ifndef TARGET_ASM_ASSEMBLE_VISIBILITY #define TARGET_ASM_ASSEMBLE_VISIBILITY default_assemble_visibility @@ -510,9 +510,9 @@ #endif /* APPLE LOCAL end mainline 2005-10-12 */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #define TARGET_ARM_EABI_UNWINDER false -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_false #define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_false @@ -589,11 +589,11 @@ #define TARGET_SECONDARY_RELOAD default_secondary_reload #endif -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef TARGET_UNWIND_TABLES_DEFAULT #define TARGET_UNWIND_TABLES_DEFAULT false #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* C++ specific. */ #ifndef TARGET_CXX_GUARD_TYPE Modified: llvm-gcc-4-2/trunk/gcc/timevar.def URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/timevar.def?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/timevar.def (original) +++ llvm-gcc-4-2/trunk/gcc/timevar.def Fri Jul 13 03:39:34 2007 @@ -174,10 +174,10 @@ /* Everything else in rest_of_compilation not included above. */ DEFTIMEVAR (TV_REST_OF_COMPILATION , "rest of compilation") -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ DEFTIMEVAR (TV_LLVM_INIT , "llvm backend init") DEFTIMEVAR (TV_LLVM_FUNCS , "llvm backend functions") DEFTIMEVAR (TV_LLVM_GLOBALS , "llvm backend globals") DEFTIMEVAR (TV_LLVM_PERFILE , "llvm backend per file") -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ Modified: llvm-gcc-4-2/trunk/gcc/toplev.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/toplev.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/toplev.c (original) +++ llvm-gcc-4-2/trunk/gcc/toplev.c Fri Jul 13 03:39:34 2007 @@ -83,9 +83,9 @@ #include "alloc-pool.h" #include "tree-mudflap.h" -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #include "llvm.h" -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO) #include "dwarf2out.h" @@ -258,12 +258,12 @@ int flag_short_enums; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ /* Options to pass directly into the LLVM backend. */ const char *llvm_optns = 0; -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* APPLE LOCAL begin -fast */ /* Nonzero if we should perform SPEC oriented optimizations. */ @@ -1196,14 +1196,14 @@ /* This must be at the end. Some target ports emit end of file directives into the assembly file here, and hence we can not output anything to the assembly file after this point. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM targetm.asm_out.file_end (); #else if (!flag_pch_file) llvm_asm_file_end(); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } /* Parse a -d... command line switch. */ @@ -1463,7 +1463,7 @@ if (!flag_syntax_only) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM targetm.asm_out.file_start (); #else @@ -1472,7 +1472,7 @@ else llvm_asm_file_start(); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ #ifdef ASM_COMMENT_START if (flag_verbose_asm) @@ -1913,11 +1913,11 @@ default_debug_hooks = &vmsdbg_debug_hooks; #endif - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM write_symbols = NO_DEBUG; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (write_symbols == NO_DEBUG) ; #if defined(DBX_DEBUGGING_INFO) @@ -2075,13 +2075,13 @@ #endif || flag_test_coverage); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* note: we need init_emit_once above to initialize ptr_mode and friends. */ llvm_initialize_backend(); return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ init_rtlanal (); init_regs (); @@ -2124,12 +2124,12 @@ init_asm_output (name); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM llvm_lang_dependent_init(name); return 1; /* don't initialize the RTL backend */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ /* These create various _DECL nodes, so need to be called after the front end is initialized. */ Modified: llvm-gcc-4-2/trunk/gcc/toplev.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/toplev.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/toplev.h (original) +++ llvm-gcc-4-2/trunk/gcc/toplev.h Fri Jul 13 03:39:34 2007 @@ -130,9 +130,9 @@ extern int time_report; /* APPLE LOCAL end optimization pragmas 3124235/3420242 */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ extern const char *llvm_optns; -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Things to do with target switches. */ extern void print_version (FILE *, const char *); Modified: llvm-gcc-4-2/trunk/gcc/tree-gimple.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree-gimple.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/tree-gimple.c (original) +++ llvm-gcc-4-2/trunk/gcc/tree-gimple.c Fri Jul 13 03:39:34 2007 @@ -156,7 +156,7 @@ return (is_gimple_val (t) || COMPARISON_CLASS_P (t)); } -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ static inline bool llvm_is_array_arrayref_extension(tree t) { @@ -170,7 +170,7 @@ #endif return false; } -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* Return true if T is something whose address can be taken. */ @@ -178,7 +178,7 @@ is_gimple_addressable (tree t) { return (is_gimple_id (t) || handled_component_p (t) - /* APPLE LOCAL LLVM */ + /* LLVM LOCAL */ || llvm_is_array_arrayref_extension (t) || INDIRECT_REF_P (t)); } Modified: llvm-gcc-4-2/trunk/gcc/tree-inline.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree-inline.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/tree-inline.c (original) +++ llvm-gcc-4-2/trunk/gcc/tree-inline.c Fri Jul 13 03:39:34 2007 @@ -1262,7 +1262,7 @@ var = modify_dest; use = NULL; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* The return node can suddenly become multiple assignment. Because of this * conservatively don't consider this thing for SSA form anymore. @@ -1270,7 +1270,7 @@ if (DECL_P (var)) DECL_GIMPLE_FORMAL_TEMP_P (var) = 0; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ goto done; } } Modified: llvm-gcc-4-2/trunk/gcc/tree-nested.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree-nested.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/tree-nested.c (original) +++ llvm-gcc-4-2/trunk/gcc/tree-nested.c Fri Jul 13 03:39:34 2007 @@ -1053,7 +1053,7 @@ of whether a NOP_EXPR or VIEW_CONVERT_EXPR needs a simple value. */ wi->val_only = true; wi->is_lhs = false; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Support the "array ref with pointer base" extension. */ for (; handled_component_p (t) || TREE_CODE(t) == ARRAY_REF; @@ -1061,7 +1061,7 @@ #else for (; handled_component_p (t); tp = &TREE_OPERAND (t, 0), t = *tp) #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ { if (TREE_CODE (t) == COMPONENT_REF) walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference, wi, @@ -1347,7 +1347,7 @@ wi->val_only = true; wi->is_lhs = false; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Support the "array ref with pointer base" extension. */ for (; handled_component_p (t) || TREE_CODE(t) == ARRAY_REF; @@ -1355,7 +1355,7 @@ #else for (; handled_component_p (t); tp = &TREE_OPERAND (t, 0), t = *tp) #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ { if (TREE_CODE (t) == COMPONENT_REF) walk_tree (&TREE_OPERAND (t, 2), convert_local_reference, wi, Modified: llvm-gcc-4-2/trunk/gcc/tree-optimize.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree-optimize.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/tree-optimize.c (original) +++ llvm-gcc-4-2/trunk/gcc/tree-optimize.c Fri Jul 13 03:39:34 2007 @@ -49,7 +49,7 @@ #include "graph.h" /* APPLE LOCAL optimization pragmas 3124235/3420242 */ #include "opts.h" -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ #include "llvm.h" #include "cfgloop.h" #include "except.h" @@ -470,13 +470,13 @@ tree_register_cfg_hooks (); /* Perform all tree transforms and optimizations. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM llvm_emit_code_for_current_function(fndecl); #else execute_pass_list (all_passes); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ bitmap_obstack_release (®_obstack); /* Release the default bitmap obstack. */ Modified: llvm-gcc-4-2/trunk/gcc/tree-pretty-print.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree-pretty-print.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/tree-pretty-print.c (original) +++ llvm-gcc-4-2/trunk/gcc/tree-pretty-print.c Fri Jul 13 03:39:34 2007 @@ -913,13 +913,13 @@ pp_string (buffer, " ..."); pp_character (buffer, ']'); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Support the "pointers in ARRAY_REF" extension */ if (TREE_CODE (TREE_TYPE (op0)) != ARRAY_TYPE) break; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ op0 = array_ref_low_bound (node); op1 = array_ref_element_size (node); Modified: llvm-gcc-4-2/trunk/gcc/tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/tree.c (original) +++ llvm-gcc-4-2/trunk/gcc/tree.c Fri Jul 13 03:39:34 2007 @@ -2000,7 +2000,7 @@ case ARRAY_REF: case ARRAY_RANGE_REF: -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ if (TREE_CODE (TYPE_SIZE (TREE_TYPE (arg))) == INTEGER_CST && TREE_CODE (TREE_OPERAND (arg, 1)) == INTEGER_CST) { @@ -2022,7 +2022,7 @@ #endif return staticp (TREE_OPERAND (arg, 0)); } else -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ return false; default: Modified: llvm-gcc-4-2/trunk/gcc/tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/tree.h (original) +++ llvm-gcc-4-2/trunk/gcc/tree.h Fri Jul 13 03:39:34 2007 @@ -2148,11 +2148,11 @@ int GTY ((tag ("0"))) address; char * GTY ((tag ("1"))) pointer; struct die_struct * GTY ((tag ("2"))) die; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ unsigned GTY ((tag ("3"))) llvm; /* Really an LLVM Type vector (LTypes) index */ } GTY ((desc ("LLVM_IS_ENABLED ? 3 : debug_hooks == &sdb_debug_hooks ? 1 : debug_hooks == &dwarf2_debug_hooks ? 2 : 0"), descbits ("2"))) symtab; -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ tree name; tree minval; tree maxval; @@ -2687,9 +2687,9 @@ { struct tree_decl_common common; rtx rtl; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ unsigned llvm; /* LLVM representation for object. */ - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ }; /* In a FIELD_DECL, this is the field position, counting in bytes, of the @@ -2791,7 +2791,7 @@ which may be different from the type seen in the program. */ #define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl_common.initial) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef ENABLE_LLVM #define LLVM_IS_ENABLED 0 #else @@ -2853,7 +2853,7 @@ #endif #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ /* For PARM_DECL, holds an RTL for the stack slot or register where the data was actually passed. */ @@ -4444,9 +4444,9 @@ extern bool tree_expr_nonzero_warnv_p (tree, bool *); /* In builtins.c */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ extern int validate_arglist (tree, ...); -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ extern tree fold_builtin (tree, tree, bool); extern tree fold_builtin_fputs (tree, bool, bool, tree); extern tree fold_builtin_strcpy (tree, tree, tree); Modified: llvm-gcc-4-2/trunk/gcc/unwind-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/unwind-c.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/unwind-c.c (original) +++ llvm-gcc-4-2/trunk/gcc/unwind-c.c Fri Jul 13 03:39:34 2007 @@ -95,7 +95,7 @@ #define CONTINUE_UNWINDING return _URC_CONTINUE_UNWIND #endif -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef __ARM_EABI_UNWINDER__ /* ARM EABI personality routines must also unwind the stack. */ #define CONTINUE_UNWINDING \ @@ -109,7 +109,7 @@ #else #define CONTINUE_UNWINDING return _URC_CONTINUE_UNWIND #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #ifdef __USING_SJLJ_EXCEPTIONS__ #define PERSONALITY_FUNCTION __gcc_personality_sj0 Modified: llvm-gcc-4-2/trunk/gcc/varasm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/varasm.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/varasm.c (original) +++ llvm-gcc-4-2/trunk/gcc/varasm.c Fri Jul 13 03:39:34 2007 @@ -53,7 +53,7 @@ #include "cgraph.h" #include "cfglayout.h" #include "basic-block.h" -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ #include "llvm.h" #ifdef XCOFF_DEBUGGING_INFO @@ -753,7 +753,7 @@ set_user_assembler_name (tree decl, const char *name) { char *starred = alloca (strlen (name) + 2); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM starred[0] = '*'; strcpy (starred + 1, name); @@ -771,15 +771,15 @@ strcpy (starred, name); } #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ change_decl_assembler_name (decl, get_identifier (starred)); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM SET_DECL_RTL (decl, NULL_RTX); #else SET_DECL_LLVM (decl, NULL_RTX); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ } /* Decode an `asm' spec for a declaration as a register name. @@ -1198,12 +1198,12 @@ void assemble_asm (tree string) { - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM llvm_emit_file_scope_asm(string); return; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ app_enable (); @@ -1343,14 +1343,14 @@ || (DECL_COMMON (decl) && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node)))) - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM || !MEM_P (DECL_RTL (decl)) #else || (DECL_LLVM (decl), 0) #endif ) - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ return; /* We win when global object is found, but it is useful to know about weak @@ -1363,7 +1363,7 @@ const char *p; const char *name; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM rtx decl_rtl = DECL_RTL (decl); name = (char*)XSTR (XEXP (decl_rtl, 0), 0); @@ -1372,7 +1372,7 @@ name = (char*)llvm_get_decl_name(decl_llvm); #endif p = targetm.strip_name_encoding (name); - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ name = ggc_strdup (p); *type = name; @@ -1772,11 +1772,11 @@ const char *name; rtx decl_rtl, symbol; section *sect; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM void *decl_llvm; #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ if (lang_hooks.decls.prepare_assemble_variable) lang_hooks.decls.prepare_assemble_variable (decl); @@ -1796,7 +1796,7 @@ if (TREE_CODE (decl) == FUNCTION_DECL) return; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM /* register globals are not supported */ /* Do nothing for global register variables. */ if (DECL_RTL_SET_P (decl) && REG_P (DECL_RTL (decl))) @@ -1805,7 +1805,7 @@ return; } #endif - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ /* If type was incomplete when the variable was declared, see if it is complete now. */ @@ -1833,13 +1833,13 @@ /* Make sure targetm.encode_section_info is invoked before we set ASM_WRITTEN. */ - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM /* register globals are not supported */ decl_rtl = DECL_RTL (decl); #else decl_llvm = DECL_LLVM (decl); #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ TREE_ASM_WRITTEN (decl) = 1; @@ -1863,7 +1863,7 @@ gcc_assert (MEM_P (decl_rtl)); gcc_assert (GET_CODE (XEXP (decl_rtl, 0)) == SYMBOL_REF); - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM /* register globals are not supported */ symbol = XEXP (decl_rtl, 0); name = XSTR (symbol, 0); @@ -2046,7 +2046,7 @@ open. If it's not, we should not be calling this function. */ gcc_assert (asm_out_file); - /* APPLE LOCAL llvm */ + /* LLVM LOCAL */ #if defined(ASM_OUTPUT_EXTERNAL) && !defined(ENABLE_LLVM) if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)) return; @@ -4695,7 +4695,7 @@ { DECL_WEAK (decl) = 1; - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM if (DECL_LLVM_SET_P (decl)) llvm_mark_decl_weak(decl); @@ -4906,11 +4906,11 @@ } } - /* APPLE LOCAL begin LLVM */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM return; /* llvm-gcc doesn't need this. */ #endif - /* APPLE LOCAL end LLVM */ + /* LLVM LOCAL end */ for (t = weak_decls; t; t = TREE_CHAIN (t)) { @@ -5031,7 +5031,7 @@ or ASM_OUTPUT_DEF_FROM_DECLS. The function defines the symbol whose tree node is DECL to have the value of the tree node TARGET. */ -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ #ifndef ENABLE_LLVM static void do_assemble_alias (tree decl, tree target) @@ -5111,7 +5111,7 @@ } #endif } -/* APPLE LCOAL LLVM */ +/* LLVM LCOAL */ #endif /* First pass of completing pending aliases. Make sure that cgraph knows @@ -5152,7 +5152,7 @@ alias_pair *p; for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p); i++) -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM { tree target_decl; @@ -5162,7 +5162,7 @@ #else do_assemble_alias (p->decl, p->target); #endif -/*APPLE LOCAL end LLVM */ +/*LLVM LOCAL end */ VEC_truncate (alias_pair, alias_pairs, 0); } @@ -5214,13 +5214,13 @@ /* We must force creation of DECL_RTL for debug info generation, even though we don't use it here. */ -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef ENABLE_LLVM make_decl_rtl (decl); #else make_decl_llvm (decl); #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ TREE_USED (decl) = 1; /* A quirk of the initial implementation of aliases required that the user Modified: llvm-gcc-4-2/trunk/libcpp/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libcpp/Makefile.in?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libcpp/Makefile.in (original) +++ llvm-gcc-4-2/trunk/libcpp/Makefile.in Fri Jul 13 03:39:34 2007 @@ -37,14 +37,14 @@ WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@ CPP = @CPP@ -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin LLVMBASEPATH = @LLVMBASEPATH@ ifeq ($(LLVMBASEPATH),) CPPFLAGS = @CPPFLAGS@ else CPPFLAGS = @CPPFLAGS@ -DENABLE_LLVM endif -# APPLE LOCAL end LLVM +# LLVM LOCAL end EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ Modified: llvm-gcc-4-2/trunk/libcpp/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libcpp/configure?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libcpp/configure (original) +++ llvm-gcc-4-2/trunk/libcpp/configure Fri Jul 13 03:39:34 2007 @@ -8263,7 +8263,7 @@ _ACEOF -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin # Check whether --enable-llvm or --disable-llvm was given. if test "${enable_llvm+set}" = set; then enableval="$enable_llvm" @@ -8301,7 +8301,7 @@ LLVMBASEPATH="" fi; -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Output. Modified: llvm-gcc-4-2/trunk/libcpp/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libcpp/configure.ac?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libcpp/configure.ac (original) +++ llvm-gcc-4-2/trunk/libcpp/configure.ac Fri Jul 13 03:39:34 2007 @@ -144,7 +144,7 @@ [Define to the widest efficient host integer type at least as wide as the target's size_t type.]) -# APPLE LOCAL begin LLVM +# LLVM LOCAL begin AC_ARG_ENABLE(llvm, [ --enable-llvm=DIR enable the LLVM backend, use DIR as LLVM root], [case "${enableval}" in @@ -173,7 +173,7 @@ ], [LLVMBASEPATH=""]) AC_SUBST(LLVMBASEPATH) -# APPLE LOCAL end LLVM +# LLVM LOCAL end # Output. Modified: llvm-gcc-4-2/trunk/libcpp/system.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libcpp/system.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libcpp/system.h (original) +++ llvm-gcc-4-2/trunk/libcpp/system.h Fri Jul 13 03:39:34 2007 @@ -383,7 +383,7 @@ #undef TRUE #undef FALSE -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* For LLVM, we really do want to use the system bool. Because parts of the * compiler are written in C++ and parts are written in C, the two conceptions @@ -396,7 +396,7 @@ #else # define bool unsigned char #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #define true 1 #define false 0 Modified: llvm-gcc-4-2/trunk/libiberty/strsignal.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libiberty/strsignal.c?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libiberty/strsignal.c (original) +++ llvm-gcc-4-2/trunk/libiberty/strsignal.c Fri Jul 13 03:39:34 2007 @@ -549,7 +549,7 @@ #ifndef HAVE_PSIGNAL void -/* APPLE LOCAL LLVM */ +/* LLVM LOCAL */ psignal (int signo, const char *message) { if (signal_names == NULL) Modified: llvm-gcc-4-2/trunk/libstdc++-v3/acinclude.m4 URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libstdc%2B%2B-v3/acinclude.m4?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libstdc++-v3/acinclude.m4 (original) +++ llvm-gcc-4-2/trunk/libstdc++-v3/acinclude.m4 Fri Jul 13 03:39:34 2007 @@ -2105,13 +2105,13 @@ enable_sjlj_exceptions=no elif grep __cxa_end_cleanup conftest.s >/dev/null 2>&1 ; then enable_sjlj_exceptions=no - #APPLE LOCAL begin LLVM + #LLVM LOCAL begin elif grep __cxa_end_cleanup conftest.s >/dev/null 2>&1 ; then enable_sjlj_exceptions=no - #APPLE LOCAL end LLVM + #LLVM LOCAL end fi fi - # APPLE LOCAL LLVM HACK! + # LLVM LOCAL HACK! enable_sjlj_exceptions=no CXXFLAGS="$old_CXXFLAGS" rm -f conftest* Modified: llvm-gcc-4-2/trunk/libstdc++-v3/config/cpu/i486/atomicity.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libstdc%2B%2B-v3/config/cpu/i486/atomicity.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libstdc++-v3/config/cpu/i486/atomicity.h (original) +++ llvm-gcc-4-2/trunk/libstdc++-v3/config/cpu/i486/atomicity.h Fri Jul 13 03:39:34 2007 @@ -35,28 +35,28 @@ __attribute__ ((__unused__)) __exchange_and_add(volatile _Atomic_word* __mem, int __val) { -// APPLE LOCAL LLVM +// LLVM LOCAL #ifndef __llvm__ register _Atomic_word __result; __asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}" : "=r" (__result), "=m" (*__mem) : "0" (__val), "m" (*__mem)); return __result; - // APPLE LOCAL begin LLVM + // LLVM LOCAL begin #else // FIXME: implement inline asm. _Atomic_word __result = *__mem; *__mem += __val; return __result; #endif - // APPLE LOCAL end LLVM + // LLVM LOCAL end } void __attribute__ ((__unused__)) __atomic_add(volatile _Atomic_word* __mem, int __val) { -// APPLE LOCAL LLVM +// LLVM LOCAL #ifndef __llvm__ __asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}" : "=m" (*__mem) : "ir" (__val), "m" (*__mem)); Modified: llvm-gcc-4-2/trunk/libstdc++-v3/config/cpu/powerpc/atomic_word.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libstdc%2B%2B-v3/config/cpu/powerpc/atomic_word.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libstdc++-v3/config/cpu/powerpc/atomic_word.h (original) +++ llvm-gcc-4-2/trunk/libstdc++-v3/config/cpu/powerpc/atomic_word.h Fri Jul 13 03:39:34 2007 @@ -31,7 +31,7 @@ #define _GLIBCXX_ATOMIC_WORD_H 1 typedef int _Atomic_word; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifndef __llvm__ /* FIXME: implement inline asm */ #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("isync":::"memory") #ifdef __NO_LWSYNC__ @@ -40,5 +40,5 @@ #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("lwsync":::"memory") #endif #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ #endif Modified: llvm-gcc-4-2/trunk/libstdc++-v3/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libstdc%2B%2B-v3/configure?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libstdc++-v3/configure (original) +++ llvm-gcc-4-2/trunk/libstdc++-v3/configure Fri Jul 13 03:39:34 2007 @@ -5385,7 +5385,7 @@ enable_sjlj_exceptions=no fi fi - # APPLE LOCAL LLVM HACK! + # LLVM LOCAL HACK! enable_sjlj_exceptions=no CXXFLAGS="$old_CXXFLAGS" rm -f conftest* Modified: llvm-gcc-4-2/trunk/libstdc++-v3/libsupc++/eh_personality.cc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libstdc%2B%2B-v3/libsupc%2B%2B/eh_personality.cc?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libstdc++-v3/libsupc++/eh_personality.cc (original) +++ llvm-gcc-4-2/trunk/libstdc++-v3/libsupc++/eh_personality.cc Fri Jul 13 03:39:34 2007 @@ -38,11 +38,11 @@ #define NO_SIZE_OF_ENCODED_VALUE #endif -// APPLE LOCAL begin LLVM +// LLVM LOCAL begin #ifdef __ARM_EABI_UNWINDER__ #define NO_SIZE_OF_ENCODED_VALUE #endif -// APPLE LOCAL end LLVM +// LLVM LOCAL end #include "unwind-pe.h" @@ -204,7 +204,7 @@ // Return an element from a type table. -// APPLE LOCAL begin LLVM +// LLVM LOCAL begin #ifdef __ARM_EABI_UNWINDER__ // Return an element from a type table. @@ -311,7 +311,7 @@ while (0) #else -// APPLE LOCAL end LLVM +// LLVM LOCAL end typedef const std::type_info _throw_typet; @@ -434,7 +434,7 @@ #endif // !__ARM_EABI_UNWINDER__ -// APPLE LOCAL begin LLVM +// LLVM LOCAL begin // Save stage1 handler information in the exception object static inline void @@ -477,7 +477,7 @@ #define CONTINUE_UNWINDING return _URC_CONTINUE_UNWIND #endif // !__ARM_EABI_UNWINDER__ -// APPLE LOCAL end LLVM +// LLVM LOCAL end // Return true if the filter spec is empty, ie throw(). Modified: llvm-gcc-4-2/trunk/libstdc++-v3/libsupc++/unwind-cxx.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libstdc%2B%2B-v3/libsupc%2B%2B/unwind-cxx.h?rev=39798&r1=39797&r2=39798&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libstdc++-v3/libsupc++/unwind-cxx.h (original) +++ llvm-gcc-4-2/trunk/libstdc++-v3/libsupc++/unwind-cxx.h Fri Jul 13 03:39:34 2007 @@ -226,7 +226,7 @@ #define __GXX_INIT_EXCEPTION_CLASS(c) c = __gxx_exception_class -// APPLE LOCAL begin LLVM +// LLVM LOCAL begin static inline bool __is_gxx_exception_class(_Unwind_Exception_Class c) { @@ -234,7 +234,7 @@ } #define __GXX_INIT_EXCEPTION_CLASS(c) c = __gxx_exception_class -// APPLE LOCAL end LLVM +// LLVM LOCAL end // GNU C++ personality routine, Version 0. extern "C" _Unwind_Reason_Code __gxx_personality_v0 From baldrick at free.fr Fri Jul 13 04:40:57 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 09:40:57 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39799 - /llvm-gcc-4-2/trunk/gcc/config/i386/linux.h Message-ID: <200707130940.l6D9evHm021685@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 04:40:57 2007 New Revision: 39799 URL: http://llvm.org/viewvc/llvm-project?rev=39799&view=rev Log: Misapplied patch. Modified: llvm-gcc-4-2/trunk/gcc/config/i386/linux.h Modified: llvm-gcc-4-2/trunk/gcc/config/i386/linux.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/linux.h?rev=39799&r1=39798&r2=39799&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/linux.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/linux.h Fri Jul 13 04:40:57 2007 @@ -192,11 +192,12 @@ /* i386 glibc provides __stack_chk_guard in %gs:0x14. */ #define TARGET_THREAD_SSP_OFFSET 0x14 #endif -+ /* LLVM LOCAL begin */ -+ #ifdef ENABLE_LLVM -+ -+ /* Add general target specific stuff */ -+ #include "llvm-i386-target.h" -+ -+ #endif -+ /* LLVM LOCAL end */ + +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM + +/* Add general target specific stuff */ +#include "llvm-i386-target.h" + +#endif +/* LLVM LOCAL end */ From ggreif at gmail.com Fri Jul 13 04:48:30 2007 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 13 Jul 2007 09:48:30 -0000 Subject: [llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in Message-ID: <200707130948.l6D9mUMW021977@zion.cs.uiuc.edu> Author: ggreif Date: Fri Jul 13 04:48:29 2007 New Revision: 39800 URL: http://llvm.org/viewvc/llvm-project?rev=39800&view=rev Log: * llvm.spec.in: update blurb * autoconf/AutoRegen.sh: use variables for autofoo versions * autoconf/configure.ac: test for some more functions that are not guaranteed on solaris Note: the svn:mime-type of autoconf/AutoRegen.sh should be set to something that allows for text compares using svn diff Modified: llvm/trunk/autoconf/AutoRegen.sh llvm/trunk/autoconf/configure.ac llvm/trunk/llvm.spec.in Modified: llvm/trunk/autoconf/AutoRegen.sh URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/AutoRegen.sh?rev=39800&r1=39799&r2=39800&view=diff ============================================================================== Binary files - no diff available. Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=39800&r1=39799&r2=39800&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Fri Jul 13 04:48:29 2007 @@ -721,7 +721,8 @@ dnl===-----------------------------------------------------------------------=== AC_CHECK_FUNCS([backtrace ceilf floorf roundf rintf nearbyintf getcwd ]) -AC_CHECK_FUNCS([getpagesize getrusage getrlimit setrlimit gettimeofday]) +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 ]) Modified: llvm/trunk/llvm.spec.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/llvm.spec.in?rev=39800&r1=39799&r2=39800&view=diff ============================================================================== --- llvm/trunk/llvm.spec.in (original) +++ llvm/trunk/llvm.spec.in Fri Jul 13 04:48:29 2007 @@ -15,8 +15,9 @@ 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 3.4 and 4.0.1. The compiler infrastructure +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. From gabor at mac.com Fri Jul 13 04:52:14 2007 From: gabor at mac.com (Gabor Greif) Date: Fri, 13 Jul 2007 11:52:14 +0200 Subject: [llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in Message-ID: <46974B4E.5080500@mac.com> Unfortunately I could not regenerate configure because I am missing autoconf 2.60 (have 2.59 only) Reid or Chris, can somebody run autoconf/AutoRegen.sh and check in configure ? I sincerely hope that I did not mess up anything :-O Cheers, Gabor From rspencer at reidspencer.com Fri Jul 13 05:02:45 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 13 Jul 2007 10:02:45 -0000 Subject: [llvm-commits] [llvm] r39801 - /llvm/trunk/autoconf/AutoRegen.sh Message-ID: <200707131002.l6DA2j1S022392@zion.cs.uiuc.edu> Author: reid Date: Fri Jul 13 05:02:45 2007 New Revision: 39801 URL: http://llvm.org/viewvc/llvm-project?rev=39801&view=rev Log: Set the mime-type of this file to text/plain because (silly) SVN doesn't know that application/x-sh is text. Modified: llvm/trunk/autoconf/AutoRegen.sh (props changed) Propchange: llvm/trunk/autoconf/AutoRegen.sh ------------------------------------------------------------------------------ --- svn:mime-type (original) +++ svn:mime-type Fri Jul 13 05:02:45 2007 @@ -1 +1 @@ -application/x-sh +text/plain From rspencer at reidspencer.com Fri Jul 13 05:05:31 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 13 Jul 2007 10:05:31 -0000 Subject: [llvm-commits] [llvm] r39802 - in /llvm/trunk: configure include/llvm/Config/config.h.in Message-ID: <200707131005.l6DA5WTo022489@zion.cs.uiuc.edu> Author: reid Date: Fri Jul 13 05:05:30 2007 New Revision: 39802 URL: http://llvm.org/viewvc/llvm-project?rev=39802&view=rev Log: Regenerate to pick up Gabor's changes. Modified: llvm/trunk/configure llvm/trunk/include/llvm/Config/config.h.in Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=39802&r1=39801&r2=39802&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Fri Jul 13 05:05:30 2007 @@ -30140,6 +30140,119 @@ +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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 Modified: llvm/trunk/include/llvm/Config/config.h.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=39802&r1=39801&r2=39802&view=diff ============================================================================== --- llvm/trunk/include/llvm/Config/config.h.in (original) +++ llvm/trunk/include/llvm/Config/config.h.in Fri Jul 13 05:05:30 2007 @@ -115,6 +115,9 @@ /* 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 @@ -270,6 +273,9 @@ /* 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 @@ -294,6 +300,9 @@ /* 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 @@ -369,6 +378,9 @@ /* 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 From rspencer at reidspencer.com Fri Jul 13 05:05:37 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 13 Jul 2007 03:05:37 -0700 Subject: [llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in In-Reply-To: <46974B4E.5080500@mac.com> References: <46974B4E.5080500@mac.com> Message-ID: <1184321137.3144.222.camel@bashful.x10sys.com> Gabor, Done. Reid. On Fri, 2007-07-13 at 11:52 +0200, Gabor Greif wrote: > Unfortunately I could not regenerate configure > because I am missing autoconf 2.60 (have 2.59 only) > > Reid or Chris, can somebody run autoconf/AutoRegen.sh > and check in configure ? > > I sincerely hope that I did not mess up anything :-O > > Cheers, > > Gabor > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From ggreif at gmail.com Fri Jul 13 05:08:18 2007 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 13 Jul 2007 10:08:18 -0000 Subject: [llvm-commits] [llvm] r39803 - in /llvm/trunk/test/CodeGen/PowerPC: 2006-01-20-ShiftPartsCrash.ll 2006-08-15-SelectionCrash.ll Message-ID: <200707131008.l6DA8JuH022608@zion.cs.uiuc.edu> Author: ggreif Date: Fri Jul 13 05:08:18 2007 New Revision: 39803 URL: http://llvm.org/viewvc/llvm-project?rev=39803&view=rev Log: these tests do not need a triple on Solaris. Thanks sabre! Modified: llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll Modified: llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll?rev=39803&r1=39802&r2=39803&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll Fri Jul 13 05:08:18 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 +; RUN: llvm-upgrade < %s | llvm-as | llc void %iterative_hash_host_wide_int() { %zero = alloca int ; [#uses=2] Modified: llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll?rev=39803&r1=39802&r2=39803&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll Fri Jul 13 05:08:18 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 +; RUN: llvm-upgrade < %s | llvm-as | llc %struct..0anon = type { int } %struct.rtx_def = type { ushort, ubyte, ubyte, [1 x %struct..0anon] } From gabor at mac.com Fri Jul 13 05:24:20 2007 From: gabor at mac.com (Gabor Greif) Date: Fri, 13 Jul 2007 12:24:20 +0200 Subject: [llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in References: 46974B4E.5080500@mac.com Message-ID: <469752D4.4070708@mac.com> Thanks, Reid! in your include/llvm/Config/config.h what do you get for powf fmodf strtof round ? i.e. I have /* #undef HAVE_POWF */ /* #undef HAVE_FMODF */ /* #undef HAVE_STRTOF */ /* #undef HAVE_ROUND */ Cheers! Gabor From baldrick at free.fr Fri Jul 13 06:25:00 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 11:25:00 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39804 - /llvm-gcc-4-2/trunk/build_gcc Message-ID: <200707131125.l6DBP0xK024776@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 06:24:59 2007 New Revision: 39804 URL: http://llvm.org/viewvc/llvm-project?rev=39804&view=rev Log: Correct the directory that the man pages are installed into. Modified: llvm-gcc-4-2/trunk/build_gcc Modified: llvm-gcc-4-2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/build_gcc?rev=39804&r1=39803&r2=39804&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/build_gcc (original) +++ llvm-gcc-4-2/trunk/build_gcc Fri Jul 13 06:24:59 2007 @@ -155,7 +155,7 @@ CONFIGFLAGS="--disable-checking --enable-werror \ --prefix=$DEST_ROOT \ - --mandir=$DEST_ROOT/share/man \ + --mandir=$LLVM_INSTALL_PREFIX/share/man \ --enable-languages=c,objc,c++,obj-c++ \ --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \ $LIBSTDCXX_CONFIG_OPTION \ @@ -352,9 +352,9 @@ cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* ".$HTMLDIR/" || exit 1 # Manual pages -mkdir -p .$DEST_ROOT/share || exit 1 +mkdir -p .$LLVM_INSTALL_PREFIX/share || exit 1 # LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT -cp -Rp $DIR/dst-$BUILD-$BUILD/$DEST_ROOT/share/man .$DEST_ROOT/share/ \ +cp -Rp $DIR/dst-$BUILD-$BUILD$LLVM_INSTALL_PREFIX/share/man .$LLVM_INSTALL_PREFIX/share/ \ || exit 1 # exclude fsf-funding.7 gfdl.7 gpl.7 as they are currently built in # the gcc project @@ -477,7 +477,7 @@ done # Add extra man page symlinks for 'c++' and for arch-specific names. -MDIR=$DEST_DIR$DEST_ROOT/share/man/man1 +MDIR=$DEST_DIR$LLVM_INSTALL_PREFIX/share/man/man1 ln -f $MDIR/g++-$MAJ_VERS.1 $MDIR/c++-$MAJ_VERS.1 || exit 1 for t in $TARGETS ; do ln -f $MDIR/gcc-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-gcc-$VERS.1 \ From baldrick at free.fr Fri Jul 13 07:10:00 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 12:10:00 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39805 - in /llvm-gcc-4-2/trunk/gcc: llvm-convert.cpp llvm-internal.h Message-ID: <200707131210.l6DCA0g2026083@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 07:09:59 2007 New Revision: 39805 URL: http://llvm.org/viewvc/llvm-project?rev=39805&view=rev Log: Forward port of [129185]. Handle nested try-catch statements: From Duncan These patches, to LLVM and llvm-gcc, add support for nested try-catch statements. Previously, only the inner most catch or filter was being taken into account. Thanks to inlining it is possible for a function to contain any number of filters and catches nested within each other (without inlining filters only occur outermost). To support this I've junked the eh.filter intrinsic and extended the eh.selector intrinsic so it can simultaneously contain catches and filters. To indicate a filter, the number of typeinfos in the filter is given as an argument, followed by the typeinfos themselves. For example, %s = eh.selector(exception,personality,t1,2,t2,t3,t4); has a catch (typeinfo t1) followed by a filter of length 2 (typeinfos t2 and t3) followed by another catch (typeinfo t4). This is not very beautiful but it is simple, effective and unambiguous. An alternative would have been to keep eh.filter and output multiple filter/selector intrinsics like this: %s1 = eh.selector(exception,personality,t4); %s2 = eh.filter(exception,personality,t2,t3); %s3 = eh.selector(exception,personality,t1); (yes, in reverse order). Then %s1 and %s2 would never be used, and %s3 would be tested against the various typeinfos, even if they were never mentioned in the %s3 selector itself (eg t4). It also requires extra mucking around with the live-in markings for the exception and selector registers produced during codegen. I decided it was better to enhance eh.selector and get rid of eh.filter. Note that this means that eh.selector now corresponds directly to the action sequence in the dwarf eh table. The testcase shows the difference before and after (I've simplified the output a bit): Before: %eh_select = call @llvm.eh.filter(%eh_ptr, @__gxx_personality_v0, null) ; "empty" filter [the "null" should not be here - also fixed in this patch] After: %eh_select = call @llvm.eh.selector(%eh_ptr, @__gxx_personality_v0, i32 0, ; empty filter @_ZTI3One, ; catch i32 1, @_ZTI3Two, ; filter of length 1 @_ZTI5Three, @_ZTI4Four, ; two catches i32 2, @_ZTI4Five, @_ZTI3Six, ; filter of length 2 null) ; catch-all Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp llvm-gcc-4-2/trunk/gcc/llvm-internal.h Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39805&r1=39804&r2=39805&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 07:09:59 2007 @@ -350,7 +350,6 @@ ExceptionSelectorValue = 0; FuncEHException = 0; FuncEHSelector = 0; - FuncEHFilter = 0; FuncEHGetTypeID = 0; FuncCPPPersonality = 0; FuncUnwindResume = 0; @@ -1965,16 +1964,18 @@ /// GatherTypeInfo - Walk through the expression gathering all the /// typeinfos that are used. void TreeToLLVM::GatherTypeInfo(tree exp, - std::vector &TypeInfos) { + std::vector &TypeInfos) { if (TREE_CODE(exp) == CATCH_EXPR || TREE_CODE(exp) == EH_FILTER_EXPR) { tree Types = TREE_CODE(exp) == CATCH_EXPR ? CATCH_TYPES(exp) : EH_FILTER_TYPES(exp); if (!Types) { - // Catch all. - TypeInfos.push_back( - Constant::getNullValue(PointerType::get(Type::Int8Ty)) - ); + // Catch all or empty filter. + if (TREE_CODE(exp) == CATCH_EXPR) + // Catch all. + TypeInfos.push_back( + Constant::getNullValue(PointerType::get(Type::Int8Ty)) + ); } else if (TREE_CODE(Types) != TREE_LIST) { // Construct typeinfo object. Each call will produce a new expression // even if duplicate. @@ -1982,7 +1983,7 @@ // Produce value. Duplicate typeinfo get folded here. Value *TypeInfo = Emit(TypeInfoNopExpr, 0); // Capture typeinfo. - TypeInfos.push_back(TypeInfo); + TypeInfos.push_back(cast(TypeInfo)); } else { for (; Types; Types = TREE_CHAIN (Types)) { // Construct typeinfo object. Each call will produce a new expression @@ -1991,7 +1992,7 @@ // Produce value. Duplicate typeinfo get folded here. Value *TypeInfo = Emit(TypeInfoNopExpr, 0); // Capture typeinfo. - TypeInfos.push_back(TypeInfo); + TypeInfos.push_back(cast(TypeInfo)); } } } else if (TREE_CODE(exp) == STATEMENT_LIST) { @@ -2007,47 +2008,53 @@ /// AddLandingPad - Insert code to fetch and save the exception and exception /// selector. void TreeToLLVM::AddLandingPad() { - tree TryCatch = 0; - for (std::vector::reverse_iterator I = CurrentEHScopes.rbegin(), - E = CurrentEHScopes.rend(); - I != E; ++I) { - if (TREE_CODE(I->TryExpr) == TRY_CATCH_EXPR) { - TryCatch = I->TryExpr; - break; - } - } - CreateExceptionValues(); // Fetch and store the exception. Value *Ex = Builder.CreateCall(FuncEHException, "eh_ptr"); Builder.CreateStore(Ex, ExceptionValue); - if (!TryCatch) return; - - // Gather the typeinfo. - std::vector TypeInfos; - tree Catches = TREE_OPERAND(TryCatch, 1); - GatherTypeInfo(Catches, TypeInfos); - - // Choose type of landing pad type. - Function *F = FuncEHSelector; - - if (TREE_CODE(Catches) == STATEMENT_LIST && - !tsi_end_p(tsi_start(Catches)) && - TREE_CODE(tsi_stmt(tsi_start(Catches))) == EH_FILTER_EXPR) { - F = FuncEHFilter; - } - - // Fetch and store exception handler. + // Fetch and store the exception selector. std::vector Args; - Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr")); - Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality, - PointerType::get(Type::Int8Ty))); - for (unsigned i = 0, N = TypeInfos.size(); i < N; ++i) - Args.push_back(TypeInfos[i]); - Value *Select = Builder.CreateCall(F, &Args[0], Args.size(), "eh_select"); - Builder.CreateStore(Select, ExceptionSelectorValue); + + for (std::vector::reverse_iterator I = CurrentEHScopes.rbegin(), + E = CurrentEHScopes.rend(); I != E; ++I) { + if (TREE_CODE(I->TryExpr) == TRY_CATCH_EXPR) { + if (I->InfosType == Unknown) { + // Gather the type info and determine the catch type. + tree Catches = TREE_OPERAND(I->TryExpr, 1); + GatherTypeInfo(Catches, I->TypeInfos); + I->InfosType = (TREE_CODE(Catches) == STATEMENT_LIST && + !tsi_end_p(tsi_start(Catches)) && + TREE_CODE(tsi_stmt(tsi_start(Catches))) == + EH_FILTER_EXPR) ? FilterExpr : CatchList; + } + + if (I->InfosType == CatchList && !I->TypeInfos.size()) + continue; + + // Lazily add the exception and the personality function. + if (!Args.size()) { + Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr")); + Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality, + PointerType::get(Type::Int8Ty))); + } + + if (I->InfosType == FilterExpr) + // Filter - note the size. + Args.push_back(ConstantInt::get(Type::Int32Ty, I->TypeInfos.size())); + + Args.reserve(Args.size() + I->TypeInfos.size()); + for (unsigned j = 0, N = I->TypeInfos.size(); j < N; ++j) + Args.push_back(I->TypeInfos[j]); + } + } + + if (Args.size()) { + Value *Select = Builder.CreateCall(FuncEHSelector, &Args[0], Args.size(), + "eh_select"); + Builder.CreateStore(Select, ExceptionSelectorValue); + } } @@ -2067,10 +2074,6 @@ Intrinsic::eh_exception); FuncEHSelector = Intrinsic::getDeclaration(TheModule, Intrinsic::eh_selector); -#if 0 /* FIXME FIXME */ - FuncEHFilter = Intrinsic::getDeclaration(TheModule, - Intrinsic::eh_filter); -#endif FuncEHGetTypeID = Intrinsic::getDeclaration(TheModule, Intrinsic::eh_typeid_for); Modified: llvm-gcc-4-2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-internal.h?rev=39805&r1=39804&r2=39805&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-internal.h Fri Jul 13 07:09:59 2007 @@ -258,25 +258,38 @@ BranchFixup(BranchInst *srcBranch, bool IsExceptionEdge) : SrcBranch(srcBranch), isExceptionEdge(IsExceptionEdge) {} }; - + + enum CatchTypes { Unknown = 0, CatchList, FilterExpr }; + /// EHScope - One of these scopes is maintained for each TRY_CATCH_EXPR and /// TRY_FINALLY_EXPR blocks that we are currently in. struct EHScope { /// TryExpr - This is the actual TRY_CATCH_EXPR or TRY_FINALLY_EXPR. tree_node *TryExpr; - + /// UnwindBlock - A basic block in this scope that branches to the unwind /// destination. This is lazily created by the first invoke in this scope. BasicBlock *UnwindBlock; - + // The basic blocks that are directly in this region. std::vector Blocks; - + /// BranchFixups - This is a list of fixups we need to process in this scope /// or in a parent scope. std::vector BranchFixups; - - EHScope(tree_node *expr) : TryExpr(expr), UnwindBlock(0) {} + + /// InfosType - The nature of the type infos TryExpr contains: a list of + /// CATCH_EXPR (-> CatchList) or an EH_FILTER_EXPR (-> FilterExpr). Equal + /// to Unknown if type info information has not yet been gathered. + CatchTypes InfosType; + + /// TypeInfos - The type infos corresponding to the catches or filter in + /// TryExpr. If InfosType is Unknown then this information has not yet + /// been gathered. + std::vector TypeInfos; + + EHScope(tree_node *expr) : + TryExpr(expr), UnwindBlock(0), InfosType(Unknown) {} }; /// CurrentEHScopes - The current stack of exception scopes we are @@ -305,10 +318,6 @@ /// Function *FuncEHSelector; - /// FuncEHFilter - Function used to handle the exception filtering. - /// - Function *FuncEHFilter; - /// FuncEHGetTypeID - Function used to return type id for give typeinfo. /// Function *FuncEHGetTypeID; @@ -457,7 +466,7 @@ private: /// GatherTypeInfo - Walk through the expression gathering all the /// typeinfos that are used. - void GatherTypeInfo(tree_node *exp, std::vector &TypeInfos); + void GatherTypeInfo(tree_node *exp, std::vector &TypeInfos); /// AddLandingPad - Insert code to fetch and save the exception and exception /// selector. From baldrick at free.fr Fri Jul 13 07:12:17 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 12:12:17 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39806 - /llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Message-ID: <200707131212.l6DCCHFW026148@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 07:12:16 2007 New Revision: 39806 URL: http://llvm.org/viewvc/llvm-project?rev=39806&view=rev Log: Forward port of [129234]. exception handling tweaks from Duncan: (1) Fix some comments. (2) Correct off-by-one in test for branching within the same scope (currently it never triggers, but comes out in the wash later). (3) Have all branches to the same destination share cleanup code, not just exception unwinding branches. Currently each non-unwind branch (like falling through at the end of a try scope) gets its own copy of cleanups. Change inspired by the thought that the optimizers find it easy to duplicate blocks, but hard to merge them. (4) Add a missing bitcast in a rare case. Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39806&r1=39805&r2=39806&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 07:12:16 2007 @@ -1320,21 +1320,14 @@ /// exception edge (as indicated by IsExceptionEdge) these are expanded, /// otherwise not. /// -/// Note that it is illegal for inserted cleanups to throw any exceptions, -/// as indicated by isExceptionEdge. This is an important case for -/// exception handling: when unwinding the stack due to an active exception, any -/// destructors which propagate exceptions should cause terminate to be called. -/// Thus, if a cleanup does throw an exception, its exception destination must -/// go to a designated terminate block. -/// /// Note that all calling code should emit a new basic block after this, so that /// future code does not fall after the terminator. /// void TreeToLLVM::EmitBranchInternal(BasicBlock *Dest, bool IsExceptionEdge) { // Insert the branch. BranchInst *BI = Builder.CreateBr(Dest); - - // If there are no current exception scopes, this edge *couldn't* need + + // If there are no current exception scopes, this edge *couldn't* need // cleanups. It is not possible to jump into a scope that requires a cleanup. // This keeps the C case fast. if (CurrentEHScopes.empty()) return; @@ -1344,11 +1337,10 @@ if (Dest->getParent()) { // This is a forward reference to a block. Since we know that we can't jump // INTO a region that has cleanups, we can only be branching out. - // std::map::iterator I = BlockEHScope.find(Dest); - if (I != BlockEHScope.end() && I->second == CurrentEHScopes.size()) + if (I != BlockEHScope.end() && I->second == CurrentEHScopes.size() - 1) return; // Branch within the same EH scope. - + assert((I == BlockEHScope.end() || I->second < CurrentEHScopes.size()) && "Invalid branch into EH region"); } @@ -1361,12 +1353,12 @@ /// that works. void TreeToLLVM::AddBranchFixup(BranchInst *BI, bool isExceptionEdge) { BasicBlock *Dest = BI->getSuccessor(0); - + // Check to see if we already have a fixup for this destination. std::vector &BranchFixups = CurrentEHScopes.back().BranchFixups; for (unsigned i = 0, e = BranchFixups.size(); i != e; ++i) if (BranchFixups[i].SrcBranch->getSuccessor(0) == Dest && - BranchFixups[i].isExceptionEdge) { + BranchFixups[i].isExceptionEdge == isExceptionEdge) { BranchFixup &Fixup = BranchFixups[i]; // We found a fixup for this destination already. Recycle it. if (&Fixup.SrcBranch->getParent()->front() == Fixup.SrcBranch) { @@ -2212,11 +2204,11 @@ FinallyStack.pop_back(); // Because we can emit the same cleanup in more than one context, we must - // strip off LLVM information from the decls in the code. Otherwise, the - // we will try to insert the same label into multiple places in the code. + // strip off LLVM information from the decls in the code. Otherwise, we + // will try to insert the same label into multiple places in the code. StripLLVMTranslation(CleanupCode); - - + + // Catches will supply own terminator. if (!Builder.GetInsertBlock()->getTerminator()) { // Emit a branch to the new target. @@ -2284,6 +2276,7 @@ tree TypeInfoNopExpr = (*lang_eh_runtime_type)(Types); // Produce value. Duplicate typeinfo get folded here. Value *TypeInfo = Emit(TypeInfoNopExpr, 0); + TypeInfo = BitCastToType(TypeInfo, PointerType::get(Type::Int8Ty)); // Call get eh type id. Value *TypeID = Builder.CreateCall(FuncEHGetTypeID, &TypeInfo, 1, From baldrick at free.fr Fri Jul 13 07:13:27 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 12:13:27 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39807 - /llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Message-ID: <200707131213.l6DCDR7M026202@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 07:13:27 2007 New Revision: 39807 URL: http://llvm.org/viewvc/llvm-project?rev=39807&view=rev Log: Forward port of [129251]. Duncan and Anton have found this to be safe, enable it now! at some point, we should remove the #define and the #ifdef's entirely, woo! Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39807&r1=39806&r2=39807&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 07:13:27 2007 @@ -63,7 +63,7 @@ extern int get_pointer_alignment (tree exp, unsigned int max_align); } -//#define ITANIUM_STYLE_EXCEPTIONS +#define ITANIUM_STYLE_EXCEPTIONS //===----------------------------------------------------------------------===// // Matching LLVM Values with GCC DECL trees From baldrick at free.fr Fri Jul 13 07:15:51 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 12:15:51 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39808 - /llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Message-ID: <200707131215.l6DCFpnd026294@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 07:15:51 2007 New Revision: 39808 URL: http://llvm.org/viewvc/llvm-project?rev=39808&view=rev Log: Forward port of [129262]. A function that only has cleanups (destructors) to run when an exception is raised currently is not assigned a personality function because we don't bother creating a call to eh.selector if there are no catches. But the personality function is still needed, since it is the personality function that analyses the exception table and decides where to jump to (to the cleanups in this case). This patch causes a call to eh.selector to be generated in every landing pad, even if it has no type infos, because that specifies the personality function. Patch from Duncan Sands. Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39808&r1=39807&r2=39808&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 07:15:51 2007 @@ -2009,6 +2009,11 @@ // Fetch and store the exception selector. std::vector Args; + // The exception and the personality function. + Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr")); + Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality, + PointerType::get(Type::Int8Ty))); + for (std::vector::reverse_iterator I = CurrentEHScopes.rbegin(), E = CurrentEHScopes.rend(); I != E; ++I) { if (TREE_CODE(I->TryExpr) == TRY_CATCH_EXPR) { @@ -2022,16 +2027,6 @@ EH_FILTER_EXPR) ? FilterExpr : CatchList; } - if (I->InfosType == CatchList && !I->TypeInfos.size()) - continue; - - // Lazily add the exception and the personality function. - if (!Args.size()) { - Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr")); - Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality, - PointerType::get(Type::Int8Ty))); - } - if (I->InfosType == FilterExpr) // Filter - note the size. Args.push_back(ConstantInt::get(Type::Int32Ty, I->TypeInfos.size())); @@ -2042,11 +2037,9 @@ } } - if (Args.size()) { - Value *Select = Builder.CreateCall(FuncEHSelector, &Args[0], Args.size(), - "eh_select"); - Builder.CreateStore(Select, ExceptionSelectorValue); - } + Value *Select = Builder.CreateCall(FuncEHSelector, &Args[0], Args.size(), + "eh_select"); + Builder.CreateStore(Select, ExceptionSelectorValue); } From rspencer at reidspencer.com Fri Jul 13 08:03:46 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 13 Jul 2007 06:03:46 -0700 Subject: [llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in In-Reply-To: <469752D4.4070708@mac.com> References: 46974B4E.5080500@mac.com <469752D4.4070708@mac.com> Message-ID: <1184331826.3144.230.camel@bashful.x10sys.com> On Fri, 2007-07-13 at 12:24 +0200, Gabor Greif wrote: > Thanks, Reid! > > in your include/llvm/Config/config.h > > what do you get for > > powf fmodf strtof round ? > > i.e. I have > > /* #undef HAVE_POWF */ > /* #undef HAVE_FMODF */ > /* #undef HAVE_STRTOF */ > /* #undef HAVE_ROUND */ I don't know, I didn't configure :) And I'm 6 hours late for going to bed .. sorry. > > > Cheers! > > Gabor > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Fri Jul 13 08:04:38 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 13:04:38 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39809 - in /llvm-gcc-4-2/trunk: gcc/Makefile.in gcc/configure gcc/configure.ac libcpp/configure libcpp/configure.ac Message-ID: <200707131304.l6DD4dLc027756@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 08:04:38 2007 New Revision: 39809 URL: http://llvm.org/viewvc/llvm-project?rev=39809&view=rev Log: Forward port of [129252] and [129261]. Enable llvm-gcc to build when LLVM is configured with --enable-expensive-checks. Modified: llvm-gcc-4-2/trunk/gcc/Makefile.in llvm-gcc-4-2/trunk/gcc/configure llvm-gcc-4-2/trunk/gcc/configure.ac llvm-gcc-4-2/trunk/libcpp/configure llvm-gcc-4-2/trunk/libcpp/configure.ac Modified: llvm-gcc-4-2/trunk/gcc/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/Makefile.in?rev=39809&r1=39808&r2=39809&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4-2/trunk/gcc/Makefile.in Fri Jul 13 08:04:38 2007 @@ -230,26 +230,21 @@ # LLVM LOCAL begin @checkingenabled_flag@ LLVMOBJDIR = @LLVMBASEPATH@ -ifeq ($(LLVMOBJDIR),) -CPPFLAGS = @CPPFLAGS@ -else -CPPFLAGS = @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS ifdef LLVM_VERSION_INFO CPPFLAGS += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"' endif -ifdef CHECKING_ENABLED -BUILDMODE=Debug -else -ifdef DISABLE_LLVMASSERTIONS -BUILDMODE=Release-Asserts -else -BUILDMODE=Release -endif -endif +# Determine BUILDMODE from configure run (--enable-llvm) +BUILDMODE := @LLVMBUILDMODE@ + LLVMBINPATH = $(LLVMOBJDIR)/$(BUILDMODE)/bin +ifeq ($(LLVMOBJDIR),) +CPPFLAGS = @CPPFLAGS@ +else +CPPFLAGS := @CPPFLAGS@ -DENABLE_LLVM $(shell $(LLVMBINPATH)/llvm-config --cppflags) + # Use llvm-config to get the srcdir that LLVM was configured with, to support # srcdir != objdir builds. LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root) Modified: llvm-gcc-4-2/trunk/gcc/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/configure?rev=39809&r1=39808&r2=39809&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/configure (original) +++ llvm-gcc-4-2/trunk/gcc/configure Fri Jul 13 08:04:38 2007 @@ -309,7 +309,7 @@ # include #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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn cxx_compat_warn warn_cflags WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL LLVMBASEPATH datarootdir docdir htmldir SET_MAKE AWK ! LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_selected_languages all_stagestuff build_exeext build_install_heade! rs_dir build_xm_file_list build_xm_include_list build_xm_defin! es check _languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_cxx_file out_object_file out_cxx_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' +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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn cxx_compat_warn warn_cflags WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL LLVMBASEPATH LLVMBUILDMODE datarootdir docdir htmldir! SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_selected_languages all_stagestuff build_exeext build! _install_headers_dir build_xm_file_list build_xm_include_list ! build_xm _defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_cxx_file out_object_file out_cxx_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' ac_subst_files='language_hooks' # Initialize some variables set by options. @@ -7370,10 +7370,28 @@ if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then echo Found Release LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then echo Found Debug LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts" + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Checks" + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Checks" + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts+Checks" else { { echo "$as_me:$LINENO: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&5 echo "$as_me: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&2;} @@ -7382,8 +7400,12 @@ else LLVMBASEPATH="" + LLVMBUILDMODE="" + fi; +# Send llvm build mode to gcc Makefiles + # LLVM LOCAL end # Sanity check enable_languages in case someone does not run the toplevel @@ -7996,7 +8018,7 @@ else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:7999: version of makeinfo is $ac_prog_version" >&5 + echo "configure:8021: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[4-9]*) @@ -17687,6 +17709,7 @@ s, at onestep@,$onestep,;t t s, at DSYMUTIL@,$DSYMUTIL,;t t s, at LLVMBASEPATH@,$LLVMBASEPATH,;t t +s, at LLVMBUILDMODE@,$LLVMBUILDMODE,;t t s, at datarootdir@,$datarootdir,;t t s, at docdir@,$docdir,;t t s, at htmldir@,$htmldir,;t t Modified: llvm-gcc-4-2/trunk/gcc/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/configure.ac?rev=39809&r1=39808&r2=39809&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/configure.ac (original) +++ llvm-gcc-4-2/trunk/gcc/configure.ac Fri Jul 13 08:04:38 2007 @@ -855,16 +855,38 @@ if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then echo Found Release LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then echo Found Debug LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts" + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Checks" + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Checks" + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts+Checks" else AC_MSG_ERROR([You must specify valid path to your LLVM tree with --enable-llvm=DIR]) fi ], -[LLVMBASEPATH=""]) +[LLVMBASEPATH="" + LLVMBUILDMODE="" +]) AC_SUBST(LLVMBASEPATH) +# Send llvm build mode to gcc Makefiles +AC_SUBST(LLVMBUILDMODE) # LLVM LOCAL end # Sanity check enable_languages in case someone does not run the toplevel Modified: llvm-gcc-4-2/trunk/libcpp/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libcpp/configure?rev=39809&r1=39808&r2=39809&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libcpp/configure (original) +++ llvm-gcc-4-2/trunk/libcpp/configure Fri Jul 13 08:04:38 2007 @@ -8287,10 +8287,28 @@ if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then echo Found Release LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then echo Found Debug LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts" + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Checks" + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Checks" + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts+Checks" else { { echo "$as_me:$LINENO: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&5 echo "$as_me: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&2;} Modified: llvm-gcc-4-2/trunk/libcpp/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/libcpp/configure.ac?rev=39809&r1=39808&r2=39809&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/libcpp/configure.ac (original) +++ llvm-gcc-4-2/trunk/libcpp/configure.ac Fri Jul 13 08:04:38 2007 @@ -163,10 +163,28 @@ if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then echo Found Release LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then echo Found Debug LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts" + elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then + echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then + echo Found Release+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Checks" + elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Checks" + elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug-Asserts+Checks" else AC_MSG_ERROR([You must specify valid path to your LLVM tree with --enable-llvm=DIR]) fi From baldrick at free.fr Fri Jul 13 10:37:31 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 15:37:31 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39810 - in /llvm-gcc-4-2/trunk/gcc/config/i386: i386.c llvm-i386-target.h Message-ID: <200707131537.l6DFbW8T032295@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 10:37:31 2007 New Revision: 39810 URL: http://llvm.org/viewvc/llvm-project?rev=39810&view=rev Log: Make it compile on i386. Modified: llvm-gcc-4-2/trunk/gcc/config/i386/i386.c llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h Modified: llvm-gcc-4-2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/i386.c?rev=39810&r1=39809&r2=39810&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/i386.c Fri Jul 13 10:37:31 2007 @@ -1123,7 +1123,8 @@ int x86_prefetch_sse; /* ix86_regparm_string as a number */ -static int ix86_regparm; +/* LLVM local */ +int ix86_regparm; /* -mstackrealign option */ extern int ix86_force_align_arg_pointer; Modified: llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h?rev=39810&r1=39809&r2=39810&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h Fri Jul 13 10:37:31 2007 @@ -35,6 +35,8 @@ `inreg` parameter attribute */ #define LLVM_TARGET_ENABLE_REGPARM +extern int ix86_regparm; + #define LLVM_TARGET_INIT_REGPARM(local_regparm, type) \ { \ tree attr; \ From baldrick at free.fr Fri Jul 13 10:43:51 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Jul 2007 15:43:51 -0000 Subject: [llvm-commits] [llvm-gcc-4-2] r39811 - in /llvm-gcc-4-2/trunk/gcc: llvm-convert.cpp llvm-debug.cpp Message-ID: <200707131543.l6DFhpGZ032605@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 13 10:43:51 2007 New Revision: 39811 URL: http://llvm.org/viewvc/llvm-project?rev=39811&view=rev Log: Include tm_p.h to get the definition of REG_CLASS_FROM_CONSTRAINT. Simplify use of vectors with constructors, and fix some small conversion bugs while there (eg: index used for value, value used for index). Ressurect ConvertUnionCONSTRUCTOR, make it compile. FILE_TYPE has gone forever - it seems pointless to keep the comment. Before CHAR_TYPE was nuked, dwarf2out was changed to treat CHAR_TYPE and INTEGER_TYPE identically - so try to test for pascal strings using INTEGER_TYPE rather than CHAR_TYPE. Determine the encoding for INTEGER_TYPE in the same way as in dwarf2out. Break long lines. Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp llvm-gcc-4-2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39811&r1=39810&r2=39811&view=diff ============================================================================== --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 10:43:51 2007 @@ -46,6 +46,7 @@ #include "system.h" #include "coretypes.h" #include "tm.h" +#include "tm_p.h" #include "tree.h" #include "c-tree.h" // FIXME: eliminate. #include "tree-iterator.h" @@ -3675,11 +3676,9 @@ if (ConstraintChar == 'r') // REG_CLASS_FROM_CONSTRAINT doesn't support 'r' for some reason. RegClass = GENERAL_REGS; -#if 0 /* FIXME FIXME */ else - /* REG_CLASS_FROM_LETTER is now history.... find replacement... */ RegClass = REG_CLASS_FROM_CONSTRAINT(Constraint[-1], Constraint-1); -#endif + if (RegClass == NO_REGS) { // not a reg class. Result += ConstraintChar; continue; @@ -3902,7 +3901,8 @@ // Process clobbers. // Some targets automatically clobber registers across an asm. - tree Clobbers = targetm.md_asm_clobbers(ASM_OUTPUTS(exp), ASM_INPUTS(exp), ASM_CLOBBERS(exp)); + tree Clobbers = targetm.md_asm_clobbers(ASM_OUTPUTS(exp), ASM_INPUTS(exp), + ASM_CLOBBERS(exp)); for (; Clobbers; Clobbers = TREE_CHAIN(Clobbers)) { const char *RegName = TREE_STRING_POINTER(TREE_VALUE(Clobbers)); int RegCode = decode_reg_name(RegName); @@ -5151,15 +5151,19 @@ // Store each element of the constructor into the corresponding field of // DEST. if (!elt) return 0; // no elements - assert(VEC_length(constructor_elt, elt) == 0 &&"Union CONSTRUCTOR should have one element!"); - if (!VEC_index(constructor_elt, elt, 0)->value) return 0; // Not actually initialized? - - if (!ConvertType(TREE_TYPE(VEC_index(constructor_elt, elt, 0)->index))->isFirstClassType()) { - Value *V = Emit(VEC_index(constructor_elt, elt, 0)->index, DestLoc); + assert(VEC_length(constructor_elt, elt) == 1 + && "Union CONSTRUCTOR should have one element!"); + tree tree_purpose = VEC_index(constructor_elt, elt, 0)->index; + tree tree_value = VEC_index(constructor_elt, elt, 0)->value; + if (!tree_purpose) + return 0; // Not actually initialized? + + if (!ConvertType(TREE_TYPE(tree_purpose))->isFirstClassType()) { + Value *V = Emit(tree_value, DestLoc); assert(V == 0 && "Aggregate value returned in a register?"); } else { // Scalar value. Evaluate to a register, then do the store. - Value *V = Emit(VEC_index(constructor_elt, elt, 0)->value, 0); + Value *V = Emit(tree_value, 0); DestLoc = CastToType(Instruction::BitCast, DestLoc, PointerType::get(V->getType())); Builder.CreateStore(V, DestLoc); @@ -5421,16 +5425,16 @@ } unsigned NextFieldToFill = 0; - unsigned HOST_WIDE_INT elt_idx; - tree elt_purpose, elt_value; - FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), elt_idx,