Commit Graph

16119 Commits

Author SHA1 Message Date
Bill Wendling
8c51e3995d Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 00:01:33 +00:00
Bill Wendling
17689b13be Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160472 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 00:01:00 +00:00
Bill Wendling
aa7507d68d Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160471 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 23:58:37 +00:00
Jordan Rose
6ef4996b09 Allow PointerIntPairs to be created from const void *.
For a measure of safety, this conversion is only permitted if the
stored pointer type can also be created from a const void *.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160456 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 21:58:49 +00:00
Simon Atanasyan
6aef977e85 Add some missed ELF constants definitions:
- section types
- dynamic table entries tags
- state flags for DT_FLAGS_1 entry

The patch reviewed by Rafael Espindola.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160433 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 14:12:32 +00:00
NAKAMURA Takumi
2e14d27cc4 Update config.h.cmake corresponding to config.h.in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 09:17:02 +00:00
Andrew Trick
18a1b616ea SCEVTraversal: Add a visited set.
Expression trees may be DAGs. Make sure traversal has linear complexity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160426 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 05:14:03 +00:00
Jakob Stoklund Olesen
1cacae0f29 Fix broken ipo_ext_iterator constructors.
These functions have obviously never been used before.
They should be identical to the idf_ext_iterator counterparts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160381 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 17:57:25 +00:00
Jakob Stoklund Olesen
31f18eeb2b Allow for customized graph edge pruning in PostOrderIterator.h
Make it possible to prune individual graph edges from a post-order
traversal by specializing the po_iterator_storage template. Previously,
it was only possible to prune full graph nodes. Edge pruning makes it
possible to remove loop back-edges, for example.

Also replace the existing DFSetTraits customization hook with a
po_iterator_storage method for observing the post-order. DFSetTraits was
only used by LoopIterator.h which now provides a po_iterator_storage
specialization.

Thanks to Sean and Chandler for reviewing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160366 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 15:35:40 +00:00
Simon Atanasyan
7072551feb Revert commit r160307. We decide to move builtins selection to the backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160352 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 08:14:45 +00:00
Jim Grosbach
ac915b48d8 TableGen: Allow conditional instruction pattern in multiclass.
Define a 'null_frag' SDPatternOperator node, which if referenced in an
instruction Pattern, results in the pattern being collapsed to be as-if
'[]' had been specified instead. This allows supporting a multiclass
definition where some instaniations have ISel patterns associated and
others do not.

For example,
multiclass myMulti<RegisterClass rc, SDPatternOperator OpNode = null_frag> {
  def _x : myI<(outs rc:), (ins rc:), []>;
  def _r : myI<(outs rc:), (ins rc:), [(set rc:, (OpNode rc:))]>;
}

defm foo : myMulti<GRa, not>;
defm bar : myMulti<GRb>;

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160333 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 00:47:06 +00:00
Simon Atanasyan
f6978ddbec MIPS: Create two definitions for __builtin_mips_shll_qb builtin.
The first variant accepts immediate number as the second argument.
The second variant accepts register operand as the second argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16 18:51:39 +00:00
Tom Stellard
78a95d0986 Revert "include/llvm: Add R600 Intrinsics v6"
This reverts commit 600f7a90f3eef4c5108179b43e27cfd9e5de7cdc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160302 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16 18:19:48 +00:00
Tom Stellard
c3c661d4c1 include/llvm: Add R600 Intrinsics v6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160271 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16 14:17:14 +00:00
Chandler Carruth
2994937203 Add support for attaching branch weight metadata directly from the IRBuilder.
Added a basic unit test for this with CreateCondBr. I didn't go all the
way and test the switch side as the boilerplate for setting up the
switch IRBuilder unit tests is a lot more. Fortunately, the two share
all the interesting code paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160251 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16 07:45:06 +00:00
Chandler Carruth
38f488e462 Move llvm/Support/TypeBuilder.h -> llvm/TypeBuilder.h. This completes
the move of *Builder classes into the Core library.

No uses of this builder in Clang or DragonEgg I could find.

If there is a desire to have an IR-building-support library that
contains all of these builders, that can be easily added, but currently
it seems likely that these add no real overhead to VMCore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160243 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-15 23:45:24 +00:00
Chandler Carruth
e7cc0ac886 Update the header guard I missed when moving the header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160242 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-15 23:45:20 +00:00
Chandler Carruth
0baa4809a8 Move llvm/Support/MDBuilder.h to llvm/MDBuilder.h, to live with
IRBuilder, DIBuilder, etc.

This is the proper layering as MDBuilder can't be used (or implemented)
without the Core Metadata representation.

Patches to Clang and Dragonegg coming up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-15 23:26:50 +00:00
Nadav Rotem
b87bdac6a3 Refactor the code that checks that all operands of a node are UNDEFs.
Add a micro-optimization to getNode of CONCAT_VECTORS when both operands are undefs.
Can't find a testcase for this because VECTOR_SHUFFLE already handles undef operands, but Duncan suggested that we add this.

Together with Michael Kuperstein <michael.m.kuperstein@intel.com>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160229 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-15 08:38:23 +00:00
Eric Christopher
5449a1db40 Move IsSameValue from clang's ASTImporter to be methods on the
APInt/APSInt classes.

Part of rdar://11875995

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160223 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-15 00:23:36 +00:00
Andrew Trick
e08c32249f LSR Fix: check SCEV expression safety before expansion.
All SCEV expressions used by LSR formulae must be safe to
expand. i.e. they may not contain UDiv unless we can prove nonzero
denominator.

Fixes PR11356: LSR hoists UDiv.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160205 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-13 23:33:10 +00:00
Andrew Trick
8b7036b0f4 Factor SCEV traversal code so I can use it elsewhere. No functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160203 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-13 23:33:03 +00:00
Galina Kistanova
b76fb96cd6 Fixed few warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160192 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-13 21:06:54 +00:00
Alexander Kornienko
1561cee168 Initializers for some fields were missing in Option::Option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160170 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-13 12:55:23 +00:00
Eric Christopher
fc3f0b5c91 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160134 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-12 17:59:12 +00:00
Benjamin Kramer
b9bee04995 Add intrinsics for Ivy Bridge's rdrand instruction.
The rdrand/cmov sequence is the same that is emitted by both
GCC and ICC.

Fixes PR13284.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160117 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-12 09:31:43 +00:00
Chandler Carruth
4e996de58c Teach the LiveInterval::join function to use the fast merge algorithm,
generalizing its implementation sufficiently to support this value
number scenario as well.

This cuts out another significant performance hit in large functions
(over 10k basic blocks, etc), especially those with "natural" CFG
structures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10 22:25:21 +00:00
Chad Rosier
2b02688b6e Move [get|set]BasePtrStackAdjustment() from MachineFrameInfo to
X86MachineFunctionInfo as this is currently only used by X86. If this ever
becomes an issue on another arch (e.g., ARM) then we can hoist it back out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160009 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10 18:27:15 +00:00
Chad Rosier
3f0dbab963 Add support for dynamic stack realignment in the presence of dynamic allocas on
X86.  Basically, this is a reapplication of r158087 with a few fixes.

Specifically, (1) the stack pointer is restored from the base pointer before
popping callee-saved registers and (2) in obscure cases (see comments in patch)
we must cache the value of the original stack adjustment in the prologue and
apply it in the epilogue.

rdar://11496434


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10 17:45:53 +00:00
Chandler Carruth
e585e75612 Add an efficient merge operation to LiveInterval and use it to avoid
quadratic behavior when performing pathological merges. Fixes the core
element of PR12652.

There is only one user of addRangeFrom left: join. I'm hoping to
refactor further in a future patch and have join use this merge
operation as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159982 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10 05:16:17 +00:00
Chandler Carruth
261b633089 Teach LiveIntervals how to verify themselves and start using it in some
of the trick merge routines. This adds a layer of testing that was
necessary when implementing more efficient (and complex) merge logic for
this datastructure.

No functionality changed here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159981 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10 05:06:03 +00:00
Jim Grosbach
63078f2d8c Allow intrinsics to be used in place of node matchables.
TableGen has support for using an intrinics name directly in a DAG,
but this breaks down when referring to just a node, as that's
handled initializer list stuff entirely via subclassing in the
parser. That is, using an instrinsic like "(int_my_intrinsic ...)"
works fine. Using it standalone for parameterizing the operator
in such a DAG does not.

Fixing this is simple enough, as we simply declare Intrinsic
as deriving from SDPatternOperator, which is the class name
intended for exactly this purpose in TargetSelectionDAG.td.

When the intrinsic is actually used in the DAG pattern, it will
be recognized and expanded to an intrinsic_wo_chain (et. al.)
just like when it's used directly.

Incoming ARM NEON cleanup based on this and a bit of functionality
improvement after that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159973 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10 00:51:11 +00:00
Benjamin Kramer
367783223d Remove some trivial copy ctors so the classes become trivially copyable and get the optimized SmallVector implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159916 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-08 19:47:51 +00:00
Benjamin Kramer
d9cff9a25a SmallVector: Make use of move semantics to speed up moving objects in erase() and insert()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159914 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-08 12:06:35 +00:00
Andrew Trick
2661b411cc I'm introducing a new machine model to simultaneously allow simple
subtarget CPU descriptions and support new features of
MachineScheduler.

MachineModel has three categories of data:
1) Basic properties for coarse grained instruction cost model.
2) Scheduler Read/Write resources for simple per-opcode and operand cost model (TBD).
3) Instruction itineraties for detailed per-cycle reservation tables.

These will all live side-by-side. Any subtarget can use any
combination of them. Instruction itineraries will not change in the
near term. In the long run, I expect them to only be relevant for
in-order VLIW machines that have complex contraints and require a
precise scheduling/bundling model. Once itineraries are only actively
used by VLIW-ish targets, they could be replaced by something more
appropriate for those targets.

This tablegen backend rewrite sets things up for introducing
MachineModel type #2: per opcode/operand cost model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159891 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-07 04:00:00 +00:00
Andrew Trick
06495cd7f2 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-07 03:59:51 +00:00
Andrew Trick
a11a6287a5 Tweak spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159889 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-07 03:59:48 +00:00
Chad Rosier
70cfaa3464 Fix the naming of ensureAlignment. Per the coding standard function names
should be camel case, and start with a lower case letter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159877 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 23:13:38 +00:00
Bill Wendling
2da1a1621f Add a print method to the ObjC property object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 19:12:31 +00:00
Dmitri Gribenko
d8a627b33b Revert r159789.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159834 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 16:42:25 +00:00
NAKAMURA Takumi
a75ae7e8ae llvm/include/llvm/CMakeLists.txt: Cut dependency to intrinsics_gen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159831 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 15:55:39 +00:00
Dmitri Gribenko
0da21789b3 Enable new[] on llvm::BumpPtrAllocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159789 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 00:25:39 +00:00
Owen Anderson
94edc64ba2 Fix an overzealous assertion. It is legitimate for a target to have multiple fixups on a single instruction that target the same byte, so long as their bit-offsets are coordinates appropriately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159785 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 22:30:42 +00:00
Chandler Carruth
39c2a3d219 Remove dead infrastructure for building DenseMaps with a SlotIndex as
the key -- they are now stored in an IntervalMap.

I noticed this while looking into PR12652.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159745 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 11:40:23 +00:00
Chandler Carruth
d862d697d2 Finish fixing the MachineOperand hashing, providing a nice modern
hash_value overload for MachineOperands. This addresses a FIXME
sufficient for me to remove it, and cleans up the code nicely too.

The important changes to the hashing logic:
- TargetFlags are now included in all of the hashes. These were complete
  missed.
- Register operands have their subregisters and whether they are a def
  included in the hash.
- We now actually hash all of the operand types. Previously, many
  operand types were simply *dropped on the floor*. For example:
  - Floating point immediates
  - Large integer immediates (>64-bit)
  - External globals!
  - Register masks
  - Metadata operands
- It removes the offset from the block-address hash; I'm a bit
  suspicious of this, but isIdenticalTo doesn't consider the offset for
  black addresses.

Any patterns involving these entities could have triggered extreme
slowdowns in MachineCSE or PHIElimination. Let me know if there are PRs
you think might be closed now... I'm looking myself, but I may miss
them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159743 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 11:06:22 +00:00
Stepan Dyatkovskiy
b163a21940 Reverted r159658:
Optimized diff operation: implemented the case when LHS and RHS subsets contains single numbers only.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159704 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 06:07:06 +00:00
Stepan Dyatkovskiy
66d79cefcb Reverted r156659, due to probable performance regressions, DenseMap should be used here:
IntegersSubsetMapping
  - Replaced type of Items field from std::list with std::map. In neares future I'll test it with DenseMap and do the correspond replacement
    if possible.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159703 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 05:53:05 +00:00
Jakob Stoklund Olesen
33242fd3ed Add an experimental early if-conversion pass, off by default.
This pass performs if-conversion on SSA form machine code by
speculatively executing both sides of the branch and using a cmov
instruction to select the result. This can help lower the number of
branch mispredictions on architectures like x86 that don't have
predicable instructions.

The current implementation is very aggressive, and causes regressions on
mosts tests. It needs good heuristics that have yet to be implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 00:09:54 +00:00
Nuno Lopes
0dff532fce fold PHI nodes in SizeOffsetEvaluator whenever possible.
Unfortunately this change requires the cache map to hold WeakVHs instead

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159667 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 17:13:25 +00:00
Stepan Dyatkovskiy
9ccc83e7f7 IntegersSubsetMappin: cosmetic changes in diff operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159661 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 14:29:26 +00:00