Commit Graph

15922 Commits

Author SHA1 Message Date
Stepan Dyatkovskiy
5d59b0b38e IntegersSubsetMapping: added exclude operation, that allows to exclude subset of integers from current mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 07:57:36 +00:00
Stepan Dyatkovskiy
20cb4919cd IntegersSubsetMapping:
Changed type of Items collection: from std::vector to std::list.
Also some small fixes made in IntegersSubset.h, IntegersSubsetMapping.h and IntegersSubsetTest.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157987 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 07:43:08 +00:00
Andrew Trick
fc992996f7 misched: Added MultiIssueItineraries.
This allows a subtarget to explicitly specify the issue width and
other properties without providing pipeline stage details for every
instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157979 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 03:44:40 +00:00
Andrew Trick
d327d3dddd misched: Allow disabling scoreboard hazard checking for subtargets with a
valid itinerary but no pipeline stages.

An itinerary can contain useful scheduling information without specifying pipeline stages for each instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 03:44:32 +00:00
Andrew Trick
d05b46115f whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157976 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 03:44:29 +00:00
Jakob Stoklund Olesen
afb32f7fb4 Remove the last remat-related code from LiveIntervalAnalysis.
Rematerialization is handled by LiveRangeEdit now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157974 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 01:06:15 +00:00
Jakob Stoklund Olesen
3dfd59bdc3 Stop using LiveIntervals::isReMaterializable().
It is an old function that does a lot more than required by
CalcSpillWeights, which was the only remaining caller.

The isRematerializable() function never actually sets the isLoad
argument, so don't try to compute that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157973 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 01:06:12 +00:00
Jakob Stoklund Olesen
84423c8778 Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157963 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04 23:01:41 +00:00
Jakob Stoklund Olesen
15f1d8c557 Switch LiveIntervals member variable to LLVM naming standards.
No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04 22:39:14 +00:00
Roman Divacky
fd42ed676e Implement local-exec TLS on PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157935 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04 17:36:38 +00:00
Nadav Rotem
fcb2c3cf5e Remove the "-promote-elements" flag. This flag is now enabled by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157925 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04 11:27:21 +00:00
Duncan Sands
a757a0d52a getAllOnesValue also works for vectors of integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157915 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04 07:18:12 +00:00
NAKAMURA Takumi
13776d3fc8 IntRange: Restore the copy constuctor explicitly to appase buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157901 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-03 15:42:12 +00:00
Craig Topper
529ce07c5f Rename fma4 intrinsics to just fma since they are now used for both FMA4 and FMA3. Autoupgrade support coming in a separate commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157898 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-03 07:26:46 +00:00
Stepan Dyatkovskiy
31219d2cec Added unittests for IntegersSubset and IntegersSubsetMapping.
- Fixed IntegersSubsetGeneric copy/assignment behaviour. 
- Fixed IntegersSubsetGeneric::getSize/getSingleValue methods.
- Fixed IntegersSubsetGeneric::verify method.

Also IntegersSubset.h and IntegersSubsetMapping.h headers was fixed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157887 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 13:47:12 +00:00
Benjamin Kramer
d9b0b02561 Fix typos found by http://github.com/lyda/misspell-check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 10:20:22 +00:00
Stepan Dyatkovskiy
43eb31bfae PR1255: case ranges.
IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157884 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 09:42:43 +00:00
Benjamin Kramer
0fa2b7b90d Add move semantics to APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157883 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 08:39:08 +00:00
Stepan Dyatkovskiy
4524dd7518 Additional change for 157881. Forget to fix another IntegerSubset constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157882 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 08:03:34 +00:00
Stepan Dyatkovskiy
e2c53188ea Small fix due to buildbot failures on mingw32. Fixed call of parent constructor for case when parent is template.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157881 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 07:44:19 +00:00
Stepan Dyatkovskiy
4319a552ac PR1255: case ranges.
IntegersSubsetGeneric, IntegersSubsetMapping: added IntTy template parameter, that allows use either APInt or IntItem. This change allows to write unittest for these classes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157880 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 07:26:00 +00:00
Jakob Stoklund Olesen
22de91aec5 Remove the old register list functions from MCRegisterInfo.
These functions exposed the layout of the underlying data tables as
null-terminated uint16_t arrays.

Use the new MCSubRegIterator, MCSuperRegIterator, and MCRegAliasIterator
classes instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157855 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 23:28:34 +00:00
Jakob Stoklund Olesen
396618b43a Switch all register list clients to the new MC*Iterator interface.
No functional change intended.

Sorry for the churn. The iterator classes are supposed to help avoid
giant commits like this one in the future. The TableGen-produced
register lists are getting quite large, and it may be necessary to
change the table representation.

This makes it possible to do so without changing all clients (again).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157854 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 23:28:30 +00:00
Manman Ren
68f25571e7 ARM: properly handle alignment for struct byval.
Factor out the expansion code into a function.
This change is to be enabled in clang.

rdar://9877866


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157830 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 19:33:18 +00:00
Benjamin Kramer
693e3ee0c2 Provide move semantics for (Small)BitVector.
CodeGen makes a lot of BitVector copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 18:52:53 +00:00
Stepan Dyatkovskiy
6bb5c0074d PR1255: case ranges.
IntegersSubset devided into IntegersSubsetGeneric and into IntegersSubset itself. The first has no references to ConstantInt and works with IntItem only.
IntegersSubsetMapping also made generic. Here added second template parameter "IntegersSubsetTy" that allows to use on of two IntegersSubset types described below.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157815 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 16:17:57 +00:00
Benjamin Kramer
b778179b86 Remove noisy semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157814 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 15:40:53 +00:00
Stepan Dyatkovskiy
f8d14c4ca3 PR1255: case ranges.
IntItem cleanup. IntItemBase, IntItemConstantIntImp and IntItem merged into IntItem. All arithmetic operators was propogated from APInt. Also added comparison operators <,>,<=,>=. Currently you will find set of macros that propogates operators from APInt to IntItem in the beginning of IntegerSubset. Note that THESE MACROS WILL REMOVED after all passes will case-ranges compatible. Also note that these macros much smaller pain that something like this:
if (V->getValue().ugt(AnotherV->getValue()) { ... }

These changes made IntItem full featured integer object. It allows to make IntegerSubset class generic (move out all ConstantInt references inside and add unit-tests) in next commits.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157810 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 10:06:14 +00:00
Eric Christopher
fc4199bf4a Add support for enum forward declarations.
Part of rdar://11570854

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157786 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 00:22:32 +00:00
Benjamin Kramer
91a8ad71aa IntrusiveRefCntPtr: Simplify operator= as suggested by Richard Smith.
This way the constructors do all the hard work. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157773 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31 22:25:25 +00:00
Manman Ren
91c5346d91 X86: replace SUB with CMP if possible
This patch will optimize the following
        movq    %rdi, %rax
        subq    %rsi, %rax
        cmovsq  %rsi, %rdi
        movq    %rdi, %rax
to
        cmpq    %rsi, %rdi
        cmovsq  %rsi, %rdi
        movq    %rdi, %rax

Perform this optimization if the actual result of SUB is not used.

rdar: 11540023


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157755 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31 17:20:29 +00:00
Jakob Stoklund Olesen
5ddc04caf2 Add a PrintRegUnit helper similar to PrintReg.
Reg-units are named after their root registers, and most units have a
single root, so they simply print as 'AL', 'XMM0', etc. The rare dual
root reg-units print as FPSCR~FPSCR_NZCV, FP0~ST7, ...

The printing piggybacks on the existing register name tables, so no
extra const data space is required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157754 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31 17:18:29 +00:00
Jakob Stoklund Olesen
f5d4e5158f Emit register unit root tables.
Each register unit has one or two root registers. The full set of
registers containing a given register unit can be computed as the union
of the root registers and their super-registers.

Provide an MCRegUnitRootIterator class to enumerate the roots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157753 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31 17:18:26 +00:00
Craig Topper
0559a2f8ae Add intrinsic for pclmulqdq instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157731 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31 04:37:40 +00:00
Benjamin Kramer
6cf07a80ff Teach SCEV's icmp simplification logic that a-b == 0 is equivalent to a == b.
This also required making recursive simplifications until
nothing changes or a hard limit (currently 3) is hit.

With the simplification in place indvars can canonicalize
loops of the form
for (unsigned i = 0; i < a-b; ++i)
into
for (unsigned i = 0; i != a-b; ++i)
which used to fail because SCEV created a weird umax expr
for the backedge taken count.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157701 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 18:32:23 +00:00
Jakob Stoklund Olesen
cd00ef033c Add MCRegisterInfo::RegListIterator.
Also add subclasses MCSubRegIterator, MCSuperRegIterator, and
MCRegAliasIterator.

These iterators provide an abstract interface to the MCRegisterInfo
register lists so the internal representation can be changed without
changing all clients.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157695 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 16:36:28 +00:00
Benjamin Kramer
1afbd278d1 Mark insertq/extrq intrinsic readnone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157688 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 13:44:25 +00:00
Bob Wilson
6e1b812850 Add an insertPass API to TargetPassConfig. <rdar://problem/11498613>
Besides adding the new insertPass function, this patch uses it to
enhance the existing -print-machineinstrs so that the MachineInstrs
after a specific pass can be printed.

Patch by Bin Zeng!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 00:17:12 +00:00
Jakob Stoklund Olesen
209cdc2999 Make DiffListIterator public to unbreak the gcc buildbots.
Apparently, a friend can't derive from a private class according to gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157654 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 00:05:03 +00:00
Jakob Stoklund Olesen
96feada378 Use MCRegUnitIterator to compute regsOverlap().
The register unit lists are typically much shorter than the register
overlap lists, and the backing table for register units has better cache
locality because it is smaller.

This makes llc about 0.5% faster. The regsOverlap() function isn't that hot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157651 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 23:40:02 +00:00
Jakob Stoklund Olesen
f52baf72c1 Emit register unit lists for each register.
Register units are already used internally in TableGen to compute
register pressure sets and overlapping registers. This patch makes them
available to the code generators.

The register unit lists are differentially encoded so they can be reused
for many related registers. This keeps the total size of the lists below
200 bytes for most targets. ARM has the largest table at 560 bytes.

Add an MCRegUnitIterator for traversing the register unit lists. It
provides an abstract interface so the representation can be changed in
the future without changing all clients.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157650 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 23:40:00 +00:00
Douglas Gregor
aad8296383 DenseMap's move assignment operator needs to return *this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157644 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 20:33:09 +00:00
Benjamin Kramer
1386e9b7b1 Add intrinsics, code gen, assembler and disassembler support for the SSE4a extrq and insertq instructions.
This required light surgery on the assembler and disassembler
because the instructions use an uncommon encoding. They are
the only two instructions in x86 that use register operands
and two immediates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 19:05:25 +00:00
Stepan Dyatkovskiy
0aa32d5d0f ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 12:26:47 +00:00
Peter Collingbourne
b34d3aa35b Add llvm.fabs intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157594 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 21:48:37 +00:00
Meador Inge
e99f8be067 PR12696: Attribute bits above 1<<30 are not encoded in bitcode
Attribute bits above 1<<30 are now encoded correctly.  Additionally,
the encoding/decoding functionality has been hoisted to helper functions
in Attributes.h in an effort to help the encoding/decoding to stay in
sync with the Attribute bitcode definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157581 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 15:45:43 +00:00
Stepan Dyatkovskiy
484fc93eff PR1255: Case Ranges
Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now?
1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst.
2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case.
3. IntItem can be easyly easily replaced with APInt.
4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes.

Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code
ConstantInt *V = ...;
if (V->getValue().ugt(AnotherV->getValue()) {
  ...
}
will look awful. Much more better this way:
IntItem V = ConstantIntVal->getValue();
if (AnotherV < V) {
}

Of course any reviews are welcome.

P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks).
Since in future these classes will founded on APInt, it will possible to use them in more generic ways.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157576 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 12:39:09 +00:00
Stepan Dyatkovskiy
ff208a79ce SwitchInst: Due to bad readability case iterators definition was moved to the end of SwitchInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157575 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 10:11:27 +00:00
Chris Lattner
d509d0b532 switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157556 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 01:47:44 +00:00
Chris Lattner
2edc74aa1f add some helper methods to make the type more uniform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157554 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 01:29:59 +00:00