summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAge
* Convert the TargetTransformInfo from an immutable pass with dynamicChandler Carruth2013-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | interfaces which could be extracted from it, and must be provided on construction, to a chained analysis group. The end goal here is that TTI works much like AA -- there is a baseline "no-op" and target independent pass which is in the group, and each target can expose a target-specific pass in the group. These passes will naturally chain allowing each target-specific pass to delegate to the generic pass as needed. In particular, this will allow a much simpler interface for passes that would like to use TTI -- they can have a hard dependency on TTI and it will just be satisfied by the stub implementation when that is all that is available. This patch is a WIP however. In particular, the "stub" pass is actually the one and only pass, and everything there is implemented by delegating to the target-provided interfaces. As a consequence the tools still have to explicitly construct the pass. Switching targets to provide custom passes and sinking the stub behavior into the NoTTI pass is the next step. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171621 91177308-0d34-0410-b5e6-96231b3b80d8
* Replicate the APIs of ScalarTargetTransformInfo andChandler Carruth2013-01-05
| | | | | | | | | | | | | | | | | | | | VectorTargetTransformInfo into the TargetTransformInfo pass, implementing them be delegating back out to the two subobjects. This is the first step to folding the interfaces together and making TargetTransformInfo a normal analysis pass (specifically an analysis group which targets can provide target-specific analysis pass implementations of). No callers are migrated here, this just stubs out the interface. Next step will be to migrate all the callers to directly operate on TTI instead of STTI or VTTI respectively. That will allow replacing the machinery for delivering TTI without changing every caller at once. WIP, I promise all the duplicated interfaces will be removed in the end, this just decouples the steps of the process. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171615 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the empty and tombstone key enumerators to not have explicitChandler Carruth2013-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | values -- that's not required to fix the bug that was cropping up, and the values selected made the enumeration's underlying type signed and introduced some warnings. This fixes the -Werror build. The underlying issue here was that the DenseMapInfo was casting values completely outside the range of the underlying storage of the enumeration to the enumeration's type. GCC went and "optimized" that into infloops and other misbehavior. By providing designated special values for these keys in the dense map, we ensure they are indeed representable and that they won't be used for anything else. It might be better to reuse None for the empty key and have the tombstone share the value of the sentinel enumerator, but honestly having 2 extra enumerators seemed not to matter and this seems a bit simpler. I'll let Bill shuffle this around (or ask me to shuffle it around) if he prefers it to look a different way. I also made the switch a bit more clear (and produce a better assert) that the enumerators are *never* going to show up and are errors if they do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171614 91177308-0d34-0410-b5e6-96231b3b80d8
* While the struct being defined in the AddressingMode.h header wasChandler Carruth2013-01-05
| | | | | | unused, there were transitive includes needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171613 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary include.Chandler Carruth2013-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171612 91177308-0d34-0410-b5e6-96231b3b80d8
* IR/Attributes: Provide EmptyKey and TombstoneKey in part of enum, as ↵NAKAMURA Takumi2013-01-05
| | | | | | | | workaround for gcc-4.4 take #2. I will investigate, later, what was wrong. I am too tired for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171611 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.NAKAMURA Takumi2013-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171601 91177308-0d34-0410-b5e6-96231b3b80d8
* DenseMap: Appease -fstrict-aliasing on g++-4.4.NAKAMURA Takumi2013-01-05
| | | | | | | | | | | | With DenseMapInfo<Enum>, it is miscompiled on g++-4.4. static inline Enum getEmptyKey() { return Enum(<arbitrary int/unsigned value>); } isEauql(getEmptyKey(), ...) The compiler mis-assumes the return value is not aliased to Enum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171600 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't call destructors on MachineInstr and MachineOperand.Jakob Stoklund Olesen2013-01-05
| | | | | | | | | | | | | | | | | | | | The series of patches leading up to this one makes llc -O0 run 8% faster. When deallocating a MachineFunction, there is no need to visit all MachineInstr and MachineOperand objects to deallocate them. All their memory come from a BumpPtrAllocator that is about to be purged, and they have empty destructors anyway. This only applies when deallocating the MachineFunction. DeleteMachineInstr() should still be used to recycle MI memory during the codegen passes. Remove the LeakDetector support for MachineInstr. I've never seen it used before, and now it definitely doesn't work. With this patch, leaked MachineInstrs would be much less of a problem since all of their memory will be reclaimed by ~MachineFunction(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171599 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ArrayRecycler for MachineInstr operand lists.Jakob Stoklund Olesen2013-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of an std::vector<MachineOperand>, use MachineOperand arrays from an ArrayRecycler living in MachineFunction. This has several advantages: - MachineInstr now has a trivial destructor, making it possible to delete them in batches when destroying MachineFunction. This will be enabled in a later patch. - Bypassing malloc() and free() can be faster, depending on the system library. - MachineInstr objects and their operands are allocated from the same BumpPtrAllocator, so they will usually be next to each other in memory, providing better locality of reference. - Reduce MachineInstr footprint. A std::vector is 24 bytes, the new operand array representation only uses 8+4+1 bytes in MachineInstr. - Better control over operand array reallocations. In the old representation, the use-def chains would be reordered whenever a std::vector reached its capacity. The new implementation never changes the use-def chain order. Note that some decisions in the code generator depend on the use-def chain orders, so this patch may cause different assembly to be produced in a few cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171598 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MachineRegisterInfo::moveOperands().Jakob Stoklund Olesen2013-01-05
| | | | | | | | | | | | | This function works like memmove() for MachineOperands, except it also updates any use-def chains containing the moved operands. The use-def chains are updated without affecting the order of operands in the list. That isn't possible when using the removeRegOperandFromUseList() and addRegOperandToUseList() functions. Callers to follow soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171597 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor the ScalarTargetTransformInfo API for querying about theChandler Carruth2013-01-05
| | | | | | | | | | | | legality of an address mode to not use a struct of four values and instead to accept them as parameters. I'd love to have named parameters here as most callers only care about one or two of these, but the defaults aren't terribly scary to write out. That said, there is no real impact of this as the passes aren't yet using STTI for this and are still relying upon TargetLowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171595 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink the AddressingModeMatcher helper class into an anonymous namespaceChandler Carruth2013-01-05
| | | | | | | | | | | | next to its only user. This helper relies on TargetLowering information that shouldn't be generally used throughout the Transfoms library, and so it made little sense as a generic utility. This also consolidates the file where we need to remove the remaining uses of TargetLowering in favor of the IR-layer abstract interface in TargetTransformInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171590 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a method to create an AttributeSet from an AttrBuilder.Bill Wendling2013-01-05
| | | | | | | | | The Attribute class is eventually going to represent one attribute. So we need this class to create the set of attributes. Add some iterator methods to the builder to access its internal bits in a nice way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171586 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an ArrayRecycler class.Jakob Stoklund Olesen2013-01-05
| | | | | | | | This is similar to the existing Recycler allocator, but instead of recycling individual objects from a BumpPtrAllocator, arrays of different sizes can be allocated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171581 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this an integer so we have enumeral types in the conditionalEric Christopher2013-01-05
| | | | | | expression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171571 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a default constructor for TimeValue. This was used, but only inChandler Carruth2013-01-05
| | | | | | | if-ed out code paths and on Windows. Hopefully restores the Windows build. Thanks to Reid Kleckner for helping triage this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171568 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warnings from llvm-gcc as seen on darwin10 (10.6).Alex Rosenberg2013-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171567 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the 'Bits' mask in the attribute builder.Bill Wendling2013-01-04
| | | | | | | | | | The bit mask thing will be a thing of the past. It's not extensible enough. Get rid of its use here. Opt instead for using a vector to hold the attributes. Note: Some of this code will become obsolete once the rewrite is further along. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171553 91177308-0d34-0410-b5e6-96231b3b80d8
* Add time getters to the process interface for requesting the elapsedChandler Carruth2013-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wall time, user time, and system time since a process started. For walltime, we currently use TimeValue's interface and a global initializer to compute a close approximation of total process runtime. For user time, this adds support for an somewhat more precise timing mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock selected. For system time, we have to do a full getrusage call to extract the system time from the OS. This is expensive but unavoidable. In passing, clean up the implementation of the old APIs and fix some latent bugs in the Windows code. This might have manifested on Windows ARM systems or other systems with strange 64-bit integer behavior. The old API for this both user time and system time simultaneously from a single getrusage call. While this results in fewer system calls, it also results in a lower precision user time and if only user time is desired, it introduces a higher overhead. It may be worthwhile to switch some of the pass timers to not track system time and directly track user and wall time. The old API also tracked walltime in a confusing way -- it just set it to the current walltime rather than providing any measure of wall time since the process started the way buth user and system time are tracked. The new API is more consistent here. The plan is to eventually implement these methods for a *child* process by using the wait3(2) system call to populate an rusage struct representing the whole subprocess execution. That way, after waiting on a child process its stats will become accurate and cheap to query. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171551 91177308-0d34-0410-b5e6-96231b3b80d8
* Special case Recycler::clear(BumpPtrAllocator).Jakob Stoklund Olesen2013-01-04
| | | | | | | | | | | | | | A BumpPtrAllocator has an empty Deallocate() method, but Recycler::clear() would still call it for every single object ever allocated, bringing all those objects into cache. As a bonus, iplist::remove() will also write to the Prev/Next pointers on all the objects, so all those cache lines have to be written back to RAM before the pages are given back to the OS. Stop wasting time and memory bandwith by using the new clearAndLeakUnsafely() function to jettison all the recycled objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171541 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an iplist::clearAndLeakNodesUnsafely() function.Jakob Stoklund Olesen2013-01-04
| | | | | | | | | | | | The iplist::clear() function can be quite expensive because it traverses the entire list, calling deleteNode() and removeNodeFromList() on each element. If node destruction and deallocation can be handled some other way, clearAndLeakNodesUnsafely() can be used to jettison all nodes without bringing them into cache. The function name is meant to be ominous. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171540 91177308-0d34-0410-b5e6-96231b3b80d8
* General cleanups.Bill Wendling2013-01-04
| | | | | | | | | | | * Remove dead methods. * Use the 'operator==' method instead of 'contains', which isn't needed. * Fix some comments. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171523 91177308-0d34-0410-b5e6-96231b3b80d8
* [Object][ELF] Add a maximum alignment. This is used by createELFObjectFile ↵Michael J. Spencer2013-01-04
| | | | | | to create a properly aligned reader. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171520 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix how YAML I/O detects flow sequences. Nick Kledzik2013-01-04
| | | | | | | | Update test case to verify flow sequence is written as a flow sequence. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171514 91177308-0d34-0410-b5e6-96231b3b80d8
* PowerPC: Fix eh_frame relocation for PIC Adhemerval Zanella2013-01-04
| | | | | | | | | | | This patch fixes the PPC eh_frame definitions for the personality and frame unwinding for PIC objects. It makes PIC build correctly creates relative relocations in the '.rela.eh_frame' segments and thus avoiding a text relocation that generates a DT_TEXTREL segments in link phase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171506 91177308-0d34-0410-b5e6-96231b3b80d8
* Add section information for the DWARF5 split debug proposalEric Christopher2013-01-04
| | | | | | string offset section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171474 91177308-0d34-0410-b5e6-96231b3b80d8
* Make comment a bit more clear.Eric Christopher2013-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171473 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopVectorizer:Nadav Rotem2013-01-04
| | | | | | | | | | 1. Add code to estimate register pressure. 2. Add code to select the unroll factor based on register pressure. 3. Add bits to TargetTransformInfo to provide the number of registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171469 91177308-0d34-0410-b5e6-96231b3b80d8
* Better comment on VTTI::getShuffleCostHal Finkel2013-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171459 91177308-0d34-0410-b5e6-96231b3b80d8
* Compiler.h: Leave LLVM_BUILTIN_UNREACHABLE undefined if it is unavailable in ↵NAKAMURA Takumi2013-01-03
| | | | | | | | | | host compiler. Users of LLVM_BUILTIN_UNREACHABLE should be responsible in the case when LLVM_BUILTIN_UNREACHABLE is undefined. Actually, (0, (p)) in LLVM_ASSUME_ALIGNED(p, a) caused thousands of warnings on g++-4.4. It was a motivation in this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171455 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a subtype parameter to VTTI::getShuffleCostHal Finkel2013-01-03
| | | | | | | | | In order to cost subvector insertion and extraction, we need to know the type of the subvector being extracted. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171453 91177308-0d34-0410-b5e6-96231b3b80d8
* Try again to revert the bad patch. The tree was reverted for some unknown reasonBill Wendling2013-01-03
| | | | | | | | | | | | | before the last time. --- Reverse-merging r171442 into '.': U include/llvm/IR/Attributes.h U lib/IR/Attributes.cpp U lib/IR/AttributeImpl.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171448 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a default Index for VTTI::getShuffleCostHal Finkel2013-01-03
| | | | | | | | When Kind == (Broadcast or Reverse) then Index is not used; make it an optional parameter. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171447 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert patch. Something snuck in there that shouldn't be.Bill Wendling2013-01-03
| | | | | | | | | | | --- Reverse-merging r171441 into '.': U include/llvm/IR/Attributes.h U lib/IR/Attributes.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171444 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the 'contains' methods in favor of the 'operator==' method.Bill Wendling2013-01-03
| | | | | | | | The 'operator==' method is a bit clearer and much less verbose for somethings that should have only one value. Remove from the AttrBuilder for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171442 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r171427, "An intermediate step in the Attributes rewrite."NAKAMURA Takumi2013-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171441 91177308-0d34-0410-b5e6-96231b3b80d8
* An intermediate step in the Attributes rewrite.Bill Wendling2013-01-02
| | | | | | | | | | | Modify the AttrBuilder class to store the attributes as a set instead of as a bit mask. The Attribute class will represent only one attribute instead of a collection of attributes. This is the wave of the future! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171427 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a bool instead of a bitfield in llvm/ADT/Optional.Argyrios Kyrtzidis2013-01-02
| | | | | | | Fixes Valgrind failures and removes bitwise operations that don't provide any benefit. Valgrind failures reported by NAKAMURA Takumi. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171413 91177308-0d34-0410-b5e6-96231b3b80d8
* Restrict __builtin_assume_aligned to gcc 4.7+Michael J. Spencer2013-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171408 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support][Endian] Add support for specifying the alignment and native ↵Michael J. Spencer2013-01-02
| | | | | | | | | | | unaligned types. * Add support for specifying the alignment to use. * Add the concept of native endianness. Used for unaligned native types. The native alignment and read/write simplification is based on a patch by Richard Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171406 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't #include stuff outside the include guards.Argyrios Kyrtzidis2013-01-02
| | | | | | This defeats the include-guard optimization when parsing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171405 91177308-0d34-0410-b5e6-96231b3b80d8
* - Add comment to two functions which might be considered as dead code. Shuxin Yang2013-01-02
| | | | | | | - Fix a typo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171399 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually update the CMake and Makefile builds correctly, and update theChandler Carruth2013-01-02
| | | | | | | | | | code that includes Intrinsics.gen directly. This never showed up in my testing because the old Intrinsics.gen was still kicking around in the make build system and was correct there. =[ Thankfully, some of the bots to clean rebuilds and that caught this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171373 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Resort the #include lines in include/... and lib/... with theChandler Carruth2013-01-02
| | | | | | | | | | utils/sort_includes.py script. Most of these are updating the new R600 target and fixing up a few regressions that have creeped in since the last time I sorted the includes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171362 91177308-0d34-0410-b5e6-96231b3b80d8
* Add IRBuilder::CreateVectorSplat and use it to simplify code.Benjamin Kramer2013-01-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171349 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it explicit that the only entry points to the Program object areChandler Carruth2012-12-31
| | | | | | | | | | | through the static helper functions. This is already true throughout the codebase. Slowly, I'm going to re-implement these static helpers in terms of a new process based interface which can expose more information, and remove the program object entirely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171335 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused method on Program.Chandler Carruth2012-12-31
| | | | | | | I'm simplifying this interface as much as I can before merging it with the new process interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171334 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused method on the Program class.Chandler Carruth2012-12-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171332 91177308-0d34-0410-b5e6-96231b3b80d8