summaryrefslogtreecommitdiff
path: root/utils
Commit message (Collapse)AuthorAge
* Add a new function, ReplaceAllUsesOfValuesWith, which handles bulkDan Gohman2008-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | replacement of multiple values. This is slightly more efficient than doing multiple ReplaceAllUsesOfValueWith calls, and theoretically could be optimized even further. However, an important property of this new function is that it handles the case where the source value set and destination value set overlap. This makes it feasible for isel to use SelectNodeTo in many very common cases, which is advantageous because SelectNodeTo avoids a temporary node and it doesn't require CSEMap updates for users of values that don't change position. Revamp MorphNodeTo, which is what does all the work of SelectNodeTo, to handle operand lists more efficiently, and to correctly handle a number of corner cases to which its new wider use exposes it. This commit also includes a change to the encoding of post-isel opcodes in SDNodes; now instead of being sandwiched between the target-independent pre-isel opcodes and the target-dependent pre-isel opcodes, post-isel opcodes are now represented as negative values. This makes it possible to test if an opcode is pre-isel or post-isel without having to know the size of the current target's post-isel instruction set. These changes speed up llc overall by 3% and reduce memory usage by 10% on the InstructionCombining.cpp testcase with -fast and -regalloc=local. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53728 91177308-0d34-0410-b5e6-96231b3b80d8
* Porting r53478 into mainline:Bill Wendling2008-07-11
| | | | | | | Update to build_llvm. Don't output a floating point number for the version. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53484 91177308-0d34-0410-b5e6-96231b3b80d8
* TargetRegisterDesc::Name field is the same as the abstract register name. ↵Evan Cheng2008-07-07
| | | | | | There is no need for targets to specify register names in addition to their AsmName's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53207 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor the tablegen DAGISelEmitter code for outputing calls toDan Gohman2008-07-07
| | | | | | | | | | | | | | | | | | getTargetNode and SelectNodeTo to reduce duplication, and to make some of the getTargetNode code available to SelectNodeTo. Use SelectNodeTo instead of getTargetNode in several new interesting cases, as it mutates nodes in place instead of creating new ones. This triggers some scheduling behavior differences due to nodes being presented to the scheduler in a different order. Some of the arbitrary scheduling decisions it makes are now arbitrarily made differently. This is visible in CodeGen/PowerPC/LargeAbsoluteAddr.ll, where a trivial scheduling difference led to a trivial register allocation difference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53203 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit keywords.Dan Gohman2008-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8
* isel load folding is disabled at -fast. Now hoist the check up to the top ↵Evan Cheng2008-07-03
| | | | | | level to save some time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53096 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace a few uses of SelectionDAG::getTargetNode withDan Gohman2008-07-02
| | | | | | | | | | | | | SelectionDAG::SelectNodeTo in the instruction selector. This updates existing nodes in place instead of creating new ones. Go back to selecting ISD::DBG_LABEL nodes into TargetInstrInfo::DBG_LABEL nodes instead of leaving them unselected, now that SelectNodeTo allows us to update them in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53057 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the subregister hashtable output more readable by wrapping the lines,Owen Anderson2008-07-01
| | | | | | | and mark it const along with the associated changes to TargetRegisterInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52966 91177308-0d34-0410-b5e6-96231b3b80d8
* Use delete[] instead of free on an array created with new[].Owen Anderson2008-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52960 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement suggestions from Chris:Owen Anderson2008-07-01
| | | | | | | | | - Use a more accurate heuristic for the size of the hashtable. - Use bitwise and instead of modulo since the size is a power of two. - Use new[] instead of malloc(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52951 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the dynamically computed std::set lookup method for subregisters ↵Owen Anderson2008-07-01
| | | | | | | | | with a hashtable-based version that is computed by tblgen at the time LLVM is compiled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52945 91177308-0d34-0410-b5e6-96231b3b80d8
* Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminatingDan Gohman2008-07-01
| | | | | | | | | | | | | | | | | the need for a flavor operand, and add a new SDNode subclass, LabelSDNode, for use with them to eliminate the need for a label id operand. Change instruction selection to let these label nodes through unmodified instead of creating copies of them. Teach the MachineInstr emitter how to emit a MachineInstr directly from an ISD label node. This avoids the need for allocating SDNodes for the label id and flavor value, as well as SDNodes for each of the post-isel label, label id, and label flavor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52943 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate TargetRegisterDesc::ImmSubRegs. It's no longer in use.Evan Cheng2008-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52892 91177308-0d34-0410-b5e6-96231b3b80d8
* check in anton's patch to make inlining happen in a determinstic orderChris Lattner2008-06-30
| | | | | | | | and fix the bug that it uncovers: inlining a pattern fragment could bring in other pattern fragments if the inlinee hadn't already been inlined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52888 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes the last x86-64 test failure in compat.exp:Dale Johannesen2008-06-26
| | | | | | | | | | | | | | | <16 x float> is 64-byte aligned (for some reason), which gets us into the stack realignment code. The computation changing FP-relative offsets to SP-relative was broken, assiging a spill temp to a location also used for parameter passing. This fixes it by rounding up the stack frame to a multiple of the largest alignment (I concluded it wasn't fixable without doing this, but I'm not very sure.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52750 91177308-0d34-0410-b5e6-96231b3b80d8
* Added MemOperands to Atomic operations since Atomics touches memory.Mon P Wang2008-06-25
| | | | | | | | | Added abstract class MemSDNode for any Node that have an associated MemOperand Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and atomic.lss => atomic.load.sub git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52706 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for building on solaris, working around namespaceChris Lattner2008-06-24
| | | | | | | polution problems from system headers. Patch by Nathan Keynes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52682 91177308-0d34-0410-b5e6-96231b3b80d8
* Extract the x86_64 part for the executables.Bill Wendling2008-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52647 91177308-0d34-0410-b5e6-96231b3b80d8
* - Add "Commutative" property to intrinsics. This allows tblgen to generate ↵Evan Cheng2008-06-16
| | | | | | | | | the commuted variants for dagisel matching code. - Mark lots of X86 intrinsics as "Commutative" to allow load folding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52353 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some debug output from tblgen. This fixes a test.Matthijs Kooijman2008-06-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52177 91177308-0d34-0410-b5e6-96231b3b80d8
* AsmParser support for immediate constant aggregate values.Dan Gohman2008-06-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52149 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap MVT::ValueType in a struct to get type safetyDuncan Sands2008-06-06
| | | | | | | | | | | | | | | | | and better control the abstraction. Rename the type to MVT. To update out-of-tree patches, the main thing to do is to rename MVT::ValueType to MVT, and rewrite expressions like MVT::getSizeInBits(VT) in the form VT.getSizeInBits(). Use VT.getSimpleVT() to extract a MVT::SimpleValueType for use in switch statements (you will get an assert failure if VT is an extended value type - these shouldn't exist after type legalization). This results in a small speedup of codegen and no new testsuite failures (x86-64 linux). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52044 91177308-0d34-0410-b5e6-96231b3b80d8
* Escape "$#".Nick Lewycky2008-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51998 91177308-0d34-0410-b5e6-96231b3b80d8
* Add #includes required by GCC 4.3, thanks for Zhongxing XuChris Lattner2008-06-04
| | | | | | | for reporting this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51926 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the polygen grammer for the new insertvalue and extractvalue syntax.Dan Gohman2008-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51879 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the position of MemOperands in nodes that use variadic_opsDan Gohman2008-06-02
| | | | | | | | | | | | | in DAGISelEmitter output. This bug was recently uncovered by the addition of patterns for CALL32m and CALL64m, which are nodes that now have both MemOperands and variadic_ops. This bug was especially visible with PIC in various configurations, because the new patterns are matching the indirect call code used in many PIC configurations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51877 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize members properly during constructionAnton Korobeynikov2008-06-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51841 91177308-0d34-0410-b5e6-96231b3b80d8
* Callback was not executed on OS X when it was a function.Mikhail Glushenkov2008-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51814 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the DAGISelEmitter to not compute the variable_ops operandDan Gohman2008-05-31
| | | | | | | | | | | | index for the input pattern in terms of the output pattern. Instead keep track of how many fixed operands the input pattern actually has, and have the input matching code pass the output-emitting function that index value. This simplifies the code, disentangles variables_ops from the support for predication operations, and makes variable_ops more robust. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51808 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 51775.Evan Cheng2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51795 91177308-0d34-0410-b5e6-96231b3b80d8
* Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.Evan Cheng2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51775 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a check for side effect-free options (specified only in the OptionList).Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51759 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactoring: remove code duplication introduced in the previous patch.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51757 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactoring: split CollectProperties into two separate function objects.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51756 91177308-0d34-0410-b5e6-96231b3b80d8
* New feature: OptionList.Mikhail Glushenkov2008-05-30
| | | | | | | | | | | | | | | | | | | It can be handy to have all information about options gathered in a single place to provide an overview of all supported options. This patch allows the following: def Options : OptionList<[ (switch_option "E", (help "Help string")), (alias_option "quiet", "q") ... ]>; Tool-specific option properties (like 'append_cmd') have (obviously) no meaning in this context, so the only properties that are allowed are 'help' and 'required'. See usage example in examples/Clang.td. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51754 91177308-0d34-0410-b5e6-96231b3b80d8
* A small optimization: use static char* array instead of StrVector.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51752 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to test if the '-o' option is provided.Mikhail Glushenkov2008-05-30
| | | | | | | | | | | The following is now allowed: (case (not_empty "o"), do_something, ...) This didn't work previously because "-o" is built-in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51751 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix: 'sink' handling was broken.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51750 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for option aliases.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51749 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow nesting of case expressions.Mikhail Glushenkov2008-05-30
| | | | | | | | | | | | The following is now legal: (case (in_language "c"), (case (switch_on "E"), "gcc -x c -E $INFILE", (default), "gcc -x c $INFILE"), (default), "gcc $INFILE $OUTFILE") git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51748 91177308-0d34-0410-b5e6-96231b3b80d8
* Small error message improvement.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51747 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove RequireDefault parameter from EmitCaseConstructHandler.Mikhail Glushenkov2008-05-30
| | | | | | | There are now no situations when 'default' is required. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51746 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some headers.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51745 91177308-0d34-0410-b5e6-96231b3b80d8
* New tests for the 'case' expression: not_empty, in_language.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51744 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to have multiple input languages for a single tool.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51742 91177308-0d34-0410-b5e6-96231b3b80d8
* Better error reporting for the 'case' construct.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51738 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not generate empty 'if's for the output_suffix property.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51737 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to use hooks like this: '$CALL(MyHook)/path/to/file'.Mikhail Glushenkov2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51734 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to change the output file suffix based on command-line options.Mikhail Glushenkov2008-05-30
| | | | | | | | | | | For instance, the following command: llvmc2 -E hello.c now generates a file with the correct suffix (hello.i). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51733 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for user-provided hooks and environment variable reads to the ↵Mikhail Glushenkov2008-05-30
| | | | | | | | | | | | | | | cmd_line tool property. Used like this: (cmd_line "$CALL(MyHook) --option -o $ENV(VARIABLE) $CALL(AnotherHook)") Also works with case expressions. Hook declarations are auto-generated, the definitions should be provided by the user (just drop a .cpp file in the tools/llvmc2 directory). Hooks should live in the "hooks" namespace and have type std::string hooks::Hook(void). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51732 91177308-0d34-0410-b5e6-96231b3b80d8