oota-llvm.git
12 years agoAdd definitions of 32/64-bit unaligned load/store instructions for Mips.
Akira Hatanaka [Sat, 2 Jun 2012 00:04:19 +0000 (00:04 +0000)]
Add definitions of 32/64-bit unaligned load/store instructions for Mips.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157865 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDefine functions MipsTargetLowering::LowerLOAD and LowerSTORE which
Akira Hatanaka [Sat, 2 Jun 2012 00:03:49 +0000 (00:03 +0000)]
Define functions MipsTargetLowering::LowerLOAD and LowerSTORE which
custom-lower unaligned load and store nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157864 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDefine Mips specific unaligned load/store nodes.
Akira Hatanaka [Sat, 2 Jun 2012 00:03:12 +0000 (00:03 +0000)]
Define Mips specific unaligned load/store nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157863 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExpand unaligned i16 loads/stores for the Mips backend.
Akira Hatanaka [Sat, 2 Jun 2012 00:02:45 +0000 (00:02 +0000)]
Expand unaligned i16 loads/stores for the Mips backend.

This is the first of a series of patches which make changes to the backend to
emit unaligned load/store instructions (lwl,lwr,swl,swr) during instruction
selection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157862 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn MipsMCInstLower::LowerSymbolOperand, get offset from symbol if
Akira Hatanaka [Sat, 2 Jun 2012 00:02:11 +0000 (00:02 +0000)]
In MipsMCInstLower::LowerSymbolOperand, get offset from symbol if
the MachineOperand type has a valid offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157861 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the old register list functions from MCRegisterInfo.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 23:28:34 +0000 (23:28 +0000)]
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

12 years agoSwitch all register list clients to the new MC*Iterator interface.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 23:28:30 +0000 (23:28 +0000)]
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

12 years agoRegister the gcov "writeout" at init time. Don't list this as a d'tor. Instead,
Bill Wendling [Fri, 1 Jun 2012 23:14:32 +0000 (23:14 +0000)]
Register the gcov "writeout" at init time. Don't list this as a d'tor. Instead,
inject some code in that will run via the "__mod_init_func" method that
registers the gcov "writeout" function to execute at exit time.

The problem is that the "__mod_term_func" method of specifying d'tors is
deprecated on Darwin. And it can lead to some ambiguities when dealing with
multiple libraries.
<rdar://problem/11110106>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157852 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove physreg support from adjustCopiesBackFrom and removeCopyByCommutingDef.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 22:38:19 +0000 (22:38 +0000)]
Remove physreg support from adjustCopiesBackFrom and removeCopyByCommutingDef.

After physreg coalescing was disabled, these functions can't do anything
useful with physregs anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157849 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSimplify some more getAliasSet callers.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 22:38:17 +0000 (22:38 +0000)]
Simplify some more getAliasSet callers.

MCRegAliasIterator can include Reg itself in the list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157848 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse dominates(Instruction, Use) in the verifier.
Rafael Espindola [Fri, 1 Jun 2012 21:56:26 +0000 (21:56 +0000)]
Use dominates(Instruction, Use) in the verifier.
This removes a bit of context from the verifier erros, but reduces code
duplication in a fairly critical part of LLVM and makes dominates easier to test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157845 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[arm-fast-isel] Fix handling of the frameaddress intrinsic. If depth is 0
Chad Rosier [Fri, 1 Jun 2012 21:12:31 +0000 (21:12 +0000)]
[arm-fast-isel] Fix handling of the frameaddress intrinsic.  If depth is 0
then DestReg is undefined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157840 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch some getAliasSet clients to MCRegAliasIterator.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 20:36:54 +0000 (20:36 +0000)]
Switch some getAliasSet clients to MCRegAliasIterator.

MCRegAliasIterator can optionally visit the register itself, allowing
for simpler code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157837 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoX86: peephole optimization to remove cmp instruction
Manman Ren [Fri, 1 Jun 2012 19:49:33 +0000 (19:49 +0000)]
X86: peephole optimization to remove cmp instruction

This patch will optimize the following:
  sub r1, r3
  cmp r3, r1 or cmp r1, r3
  bge L1
TO
  sub r1, r3
  bge L1 or ble L1

If the branch instruction can use flag from "sub", then we can eliminate
the "cmp" instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157831 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM: properly handle alignment for struct byval.
Manman Ren [Fri, 1 Jun 2012 19:33:18 +0000 (19:33 +0000)]
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

12 years agoAdd some tests checking that the verifier rejects cases where a definition
Rafael Espindola [Fri, 1 Jun 2012 19:24:57 +0000 (19:24 +0000)]
Add some tests checking that the verifier rejects cases where a definition
doesn't dominate a use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157829 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProvide move semantics for (Small)BitVector.
Benjamin Kramer [Fri, 1 Jun 2012 18:52:53 +0000 (18:52 +0000)]
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

12 years agotestcase for PR13006, thanks to Duncan for filing it.
Chris Lattner [Fri, 1 Jun 2012 18:19:46 +0000 (18:19 +0000)]
testcase for PR13006, thanks to Duncan for filing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157824 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBoundsChecking: fix a bug when the handling of recursive PHIs failed and could leave...
Nuno Lopes [Fri, 1 Jun 2012 17:43:31 +0000 (17:43 +0000)]
BoundsChecking: fix a bug when the handling of recursive PHIs failed and could leave dangling references in the cache
add regression tests for this problem.

Can already compile & run: PHP, PCRE, and ICU  (i.e., all the software I tried)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157822 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement the local-dynamic TLS model for x86 (PR3985)
Hans Wennborg [Fri, 1 Jun 2012 16:27:21 +0000 (16:27 +0000)]
Implement the local-dynamic TLS model for x86 (PR3985)

This implements codegen support for accesses to thread-local variables
using the local-dynamic model, and adds a clean-up pass so that the base
address for the TLS block can be re-used between local-dynamic access on
an execution path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157818 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR1255: case ranges.
Stepan Dyatkovskiy [Fri, 1 Jun 2012 16:17:57 +0000 (16:17 +0000)]
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

12 years agoRemove noisy semicolons.
Benjamin Kramer [Fri, 1 Jun 2012 15:40:53 +0000 (15:40 +0000)]
Remove noisy semicolons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157814 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoquick fix for PR13006, will check in testcase later.
Chris Lattner [Fri, 1 Jun 2012 15:02:52 +0000 (15:02 +0000)]
quick fix for PR13006, will check in testcase later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157813 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR1255: case ranges.
Stepan Dyatkovskiy [Fri, 1 Jun 2012 10:06:14 +0000 (10:06 +0000)]
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

12 years agoEnable automatic detection of FMA3 support to allow intrinsics to be used.
Craig Topper [Fri, 1 Jun 2012 06:10:14 +0000 (06:10 +0000)]
Enable automatic detection of FMA3 support to allow intrinsics to be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157805 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove fadd(fmul) patterns for FMA3. This needs to be implemented by paying attention...
Craig Topper [Fri, 1 Jun 2012 06:07:48 +0000 (06:07 +0000)]
Remove fadd(fmul) patterns for FMA3. This needs to be implemented by paying attention to FP_CONTRACT and matching @llvm.fma which is not available yet. This will allow us to enablle intrinsic use at least though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157804 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd VFNSUB* instructions to folding table.
Craig Topper [Fri, 1 Jun 2012 05:48:39 +0000 (05:48 +0000)]
Add VFNSUB* instructions to folding table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157802 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove a trailing space and fix a comment.
Craig Topper [Fri, 1 Jun 2012 05:34:01 +0000 (05:34 +0000)]
Remove a trailing space and fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157801 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoenhance the logic for looking through tailcalls to look through transparent casts
Chris Lattner [Fri, 1 Jun 2012 05:29:15 +0000 (05:29 +0000)]
enhance the logic for looking through tailcalls to look through transparent casts
in multiple-return value scenarios, like what happens on X86-64 when returning
small structs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157800 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTidy up. Remove trailing spaces and fix the worst of the 80 column violations.
Craig Topper [Fri, 1 Jun 2012 05:24:29 +0000 (05:24 +0000)]
Tidy up. Remove trailing spaces and fix the worst of the 80 column violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157799 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoenhance getNoopInput to know about vector<->vector bitcasts of legal
Chris Lattner [Fri, 1 Jun 2012 05:16:33 +0000 (05:16 +0000)]
enhance getNoopInput to know about vector<->vector bitcasts of legal
types, as well as int<->ptr casts.  This allows us to tailcall functions
with some trivial casts between the call and return (i.e. because the
return types disagree).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157798 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoadd some simple 64-bit tail call tests.
Chris Lattner [Fri, 1 Jun 2012 05:03:31 +0000 (05:03 +0000)]
add some simple 64-bit tail call tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157797 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorearrange some logic, no functionality change.
Chris Lattner [Fri, 1 Jun 2012 05:01:15 +0000 (05:01 +0000)]
rearrange some logic, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157796 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomerge some tests.
Chris Lattner [Fri, 1 Jun 2012 05:00:54 +0000 (05:00 +0000)]
merge some tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157795 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorename test
Chris Lattner [Fri, 1 Jun 2012 04:58:50 +0000 (04:58 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157794 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM: support struct byval in llvm
Manman Ren [Fri, 1 Jun 2012 02:44:42 +0000 (02:44 +0000)]
ARM: support struct byval in llvm

We handle struct byval by inserting a pseudo op, which will be expanded to a
loop at ExpandISelPseudos.
A separate patch for clang will be submitted to enable struct byval.

rdar://9877866

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157793 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix 80 columns.
Michael J. Spencer [Fri, 1 Jun 2012 00:58:41 +0000 (00:58 +0000)]
Fix 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157788 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for enum forward declarations.
Eric Christopher [Fri, 1 Jun 2012 00:22:32 +0000 (00:22 +0000)]
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

12 years agoPut the shiny new MCSubRegIterator to work.
Chad Rosier [Fri, 1 Jun 2012 00:02:08 +0000 (00:02 +0000)]
Put the shiny new MCSubRegIterator to work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157783 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoadd -bounds-checking-multiple-traps option to make one trap BB per check
Nuno Lopes [Thu, 31 May 2012 22:58:48 +0000 (22:58 +0000)]
add -bounds-checking-multiple-traps option to make one trap BB per check
disabled by default for now; we can discusse the default value (& name) later

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157777 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorevamp BoundsChecking considerably:
Nuno Lopes [Thu, 31 May 2012 22:45:40 +0000 (22:45 +0000)]
revamp BoundsChecking considerably:
 - compute size & offset at the same time. The side-effects of this are that we now support negative GEPs. It's now approaching a phase that it can be reused by other passes (e.g., lowering of the objectsize intrinsic)
 - use APInt throughout to handle wrap-arounds
 - add support for PHI instrumentation
 - add a cache (required for recursive PHIs anyway)
 - remove hoisting support for now, since it was wrong in a few cases

sorry for the churn here.. tests will follow soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157775 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntrusiveRefCntPtr: Simplify operator= as suggested by Richard Smith.
Benjamin Kramer [Thu, 31 May 2012 22:25:25 +0000 (22:25 +0000)]
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

12 years agoMake this testcase independent of register allocation.
Owen Anderson [Thu, 31 May 2012 18:07:02 +0000 (18:07 +0000)]
Make this testcase independent of register allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157761 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for return value promotion in X86 calling conventions.
Jakob Stoklund Olesen [Thu, 31 May 2012 17:28:20 +0000 (17:28 +0000)]
Add support for return value promotion in X86 calling conventions.

Patch by Yiannis Tsiouris!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157757 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDidn't mean to export this function.
Jakob Stoklund Olesen [Thu, 31 May 2012 17:21:27 +0000 (17:21 +0000)]
Didn't mean to export this function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157756 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoX86: replace SUB with CMP if possible
Manman Ren [Thu, 31 May 2012 17:20:29 +0000 (17:20 +0000)]
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

12 years agoAdd a PrintRegUnit helper similar to PrintReg.
Jakob Stoklund Olesen [Thu, 31 May 2012 17:18:29 +0000 (17:18 +0000)]
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

12 years agoEmit register unit root tables.
Jakob Stoklund Olesen [Thu, 31 May 2012 17:18:26 +0000 (17:18 +0000)]
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

12 years agoFix typos
Joel Jones [Thu, 31 May 2012 17:11:25 +0000 (17:11 +0000)]
Fix typos

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157752 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix typos noticed by Benjamin Kramer.
Rafael Espindola [Thu, 31 May 2012 16:04:26 +0000 (16:04 +0000)]
Fix typos noticed by Benjamin Kramer.
Also make the checks stronger and test that we reject ranges that overlap
a previous wrapped range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157749 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoX86: Rename the CLMUL target feature to PCLMUL.
Benjamin Kramer [Thu, 31 May 2012 14:34:17 +0000 (14:34 +0000)]
X86: Rename the CLMUL target feature to PCLMUL.

It was renamed in gcc/gas a while ago and causes all kinds of
confusion because it was named differently in llvm and clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157745 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRequire intervals in the range metadata to be in a canonical form: They must
Rafael Espindola [Thu, 31 May 2012 13:45:46 +0000 (13:45 +0000)]
Require intervals in the range metadata to be in a canonical form: They must
be non contiguous, non overlapping and sorted by the lower end.

While this is technically a backward incompatibility, every frontent currently
produces range metadata with a single interval and we don't have any pass
that merges intervals yet, so no existing bitcode files should be rejected by
this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157741 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdded FMA3 Intel instructions.
Elena Demikhovsky [Thu, 31 May 2012 09:20:20 +0000 (09:20 +0000)]
Added FMA3 Intel instructions.
I disabled FMA3 autodetection, since the result may differ from expected for some benchmarks.
I added tests for GodeGen and intrinsics.
I did not change llvm.fma.f32/64 - it may be done later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157737 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnhance the sinking code to handle diamond patterns. Patch by
Duncan Sands [Thu, 31 May 2012 08:09:49 +0000 (08:09 +0000)]
Enhance the sinking code to handle diamond patterns.  Patch by
Carlo Alberto Ferraris.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157736 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd intrinsic for pclmulqdq instruction.
Craig Topper [Thu, 31 May 2012 04:37:40 +0000 (04:37 +0000)]
Add intrinsic for pclmulqdq instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157731 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCleanup and factoring of mips16 tablegen classes. Make register classes
Akira Hatanaka [Thu, 31 May 2012 02:59:44 +0000 (02:59 +0000)]
Cleanup and factoring of mips16 tablegen classes. Make register classes
CPU16RegsRegClass and CPURARegRegClass available. Add definition of mips16
jalr instruction.

Patch by Reed Kotler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157730 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix typo in assembly directive. Noticed by inspection.
Eric Christopher [Thu, 31 May 2012 00:53:18 +0000 (00:53 +0000)]
Fix typo in assembly directive. Noticed by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157726 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd lit.local.cfg to run the tests in test/MC/Disassembler/Mips.
Akira Hatanaka [Thu, 31 May 2012 00:49:56 +0000 (00:49 +0000)]
Add lit.local.cfg to run the tests in test/MC/Disassembler/Mips.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157725 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAvoid depending on list orders and register numbering.
Jakob Stoklund Olesen [Wed, 30 May 2012 23:00:43 +0000 (23:00 +0000)]
Avoid depending on list orders and register numbering.

This code is covered by test/CodeGen/ARM/arm-modifier.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157720 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtract some pointer hacking to a function.
Jakob Stoklund Olesen [Wed, 30 May 2012 22:40:03 +0000 (22:40 +0000)]
Extract some pointer hacking to a function.

Switch to MCSuperRegIterator while we're there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157717 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPrioritize smaller register classes for urgent evictions.
Jakob Stoklund Olesen [Wed, 30 May 2012 21:46:58 +0000 (21:46 +0000)]
Prioritize smaller register classes for urgent evictions.

It helps compile exotic inline asm. In the test case, normal GR32
virtual registers use up eax-edx so the final GR32_ABCD live range has
no registers left. Since all the live ranges were tiny, we had no way of
prioritizing the smaller register class.

This patch allows tiny unspillable live ranges to be evicted by tiny
unspillable live ranges from a smaller register class.

<rdar://problem/11542429>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157715 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPrint uint16_t numbers without a sign.
Jakob Stoklund Olesen [Wed, 30 May 2012 19:20:19 +0000 (19:20 +0000)]
Print uint16_t numbers without a sign.

It seems I broke C++11.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157711 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for the mips inline asm 'm' output modifier.
Eric Christopher [Wed, 30 May 2012 19:05:19 +0000 (19:05 +0000)]
Add support for the mips inline asm 'm' output modifier.

Patch by Jack Carter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157709 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch the canonical FMA term operand order to match both the comment I wrote and...
Owen Anderson [Wed, 30 May 2012 18:54:50 +0000 (18:54 +0000)]
Switch the canonical FMA term operand order to match both the comment I wrote and the usual LLVM convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157708 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach DAGCombine to canonicalize the position of a constant in the term operands...
Owen Anderson [Wed, 30 May 2012 18:50:39 +0000 (18:50 +0000)]
Teach DAGCombine to canonicalize the position of a constant in the term operands of an FMA node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157707 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove extra space.
Chad Rosier [Wed, 30 May 2012 18:47:55 +0000 (18:47 +0000)]
Remove extra space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157706 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReinstate -O3 for LTO.
David Blaikie [Wed, 30 May 2012 18:42:51 +0000 (18:42 +0000)]
Reinstate -O3 for LTO.

This broke in r144788 when the CodeGenOpt option was moved from everywhere else
(specifically, from addPassesToEmitFile) to createTargetMachine. Since
LTOCodeGenerator wasn't passing the 4th argument, when the 4th parameter became
the 3rd, it silently continued to compile (int->bool conversion) but meant
something completely different.

This change preserves the existing (accidental) and previous (default)
semantics of the addPassesToEmitFile and restores the previous/intended
CodeGenOpt argument by passing it appropriately to createTargetMachine.

(discovered by pending changes to -Wconversion to catch constant->bool
conversions)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157705 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure that we're dealing with a binary SCEVExpr when simplifying.
Benjamin Kramer [Wed, 30 May 2012 18:42:43 +0000 (18:42 +0000)]
Make sure that we're dealing with a binary SCEVExpr when simplifying.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157704 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix some uses of getSubRegisters() to use getSubReg() instead.
Jakob Stoklund Olesen [Wed, 30 May 2012 18:40:49 +0000 (18:40 +0000)]
Fix some uses of getSubRegisters() to use getSubReg() instead.

It is better to address sub-registers directly by name instead of
relying on their position in the sub-register list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157703 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove some redundant tests.
Jakob Stoklund Olesen [Wed, 30 May 2012 18:38:56 +0000 (18:38 +0000)]
Remove some redundant tests.

An empty list is not represented as a null pointer. Let TRI do its own
shortcuts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157702 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach SCEV's icmp simplification logic that a-b == 0 is equivalent to a == b.
Benjamin Kramer [Wed, 30 May 2012 18:32:23 +0000 (18:32 +0000)]
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

12 years agoit's pointed out that R11 can be used for magic things, and doing things just for...
Chris Lattner [Wed, 30 May 2012 18:08:02 +0000 (18:08 +0000)]
it's pointed out that R11 can be used for magic things, and doing things just for 64-bit registers is silly.  Just optimize 3 more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157699 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtend the (abi-irrelevant) return convention to be able to return more than two...
Chris Lattner [Wed, 30 May 2012 17:50:14 +0000 (17:50 +0000)]
Extend the (abi-irrelevant) return convention to be able to return more than two values in
integer registers.  This is already supported by the fastcc convention, but it doesn't
hurt to support it in the standard conventions as well.

In cases where we can cheat at the calling convention, this allows us to avoid returning
things through memory in more cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157698 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[arm-fast-isel] Add support for the llvm.frameaddress() intrinsic.
Chad Rosier [Wed, 30 May 2012 17:23:22 +0000 (17:23 +0000)]
[arm-fast-isel] Add support for the llvm.frameaddress() intrinsic.
Patch by Jush Lu <jush.msn@gmail.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157696 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd MCRegisterInfo::RegListIterator.
Jakob Stoklund Olesen [Wed, 30 May 2012 16:36:28 +0000 (16:36 +0000)]
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

12 years agoMark insertq/extrq intrinsic readnone.
Benjamin Kramer [Wed, 30 May 2012 13:44:25 +0000 (13:44 +0000)]
Mark insertq/extrq intrinsic readnone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157688 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPort support for SSE4a extrq/insertq to the old jit code emitter.
Benjamin Kramer [Wed, 30 May 2012 09:13:55 +0000 (09:13 +0000)]
Port support for SSE4a extrq/insertq to the old jit code emitter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157685 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove little semicolon that caused a lot of warnings.
Benjamin Kramer [Wed, 30 May 2012 09:13:49 +0000 (09:13 +0000)]
Remove little semicolon that caused a lot of warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157684 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[asan] instrument cmpxchg and atomicrmw
Kostya Serebryany [Wed, 30 May 2012 09:04:06 +0000 (09:04 +0000)]
[asan] instrument cmpxchg and atomicrmw

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157683 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSCEV: Handle a corner case reducing AddRecExpr * AddRecExpr
Andrew Trick [Wed, 30 May 2012 03:35:20 +0000 (03:35 +0000)]
SCEV: Handle a corner case reducing AddRecExpr * AddRecExpr

If integer overflow causes one of the terms to reach zero, that can
force the entire expression to zero.

Fixes PR12929: cast<Ty>() argument of incompatible type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157673 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReformat the loop that does AddRecExpr * AddRecExpr reduction.
Andrew Trick [Wed, 30 May 2012 03:35:17 +0000 (03:35 +0000)]
Reformat the loop that does AddRecExpr * AddRecExpr reduction.

No functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157672 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach taildup to update livein set. rdar://11538365
Evan Cheng [Wed, 30 May 2012 00:42:39 +0000 (00:42 +0000)]
Teach taildup to update livein set. rdar://11538365

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157663 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIf-converter models predicated defs as read + write. The read should be marked as...
Evan Cheng [Wed, 30 May 2012 00:42:02 +0000 (00:42 +0000)]
If-converter models predicated defs as read + write. The read should be marked as 'undef' since it may not already be live. This appeases -verify-machineinstrs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157662 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agotypo fix
Chris Lattner [Wed, 30 May 2012 00:40:23 +0000 (00:40 +0000)]
typo fix

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157661 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd an insertPass API to TargetPassConfig. <rdar://problem/11498613>
Bob Wilson [Wed, 30 May 2012 00:17:12 +0000 (00:17 +0000)]
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

12 years agoMake DiffListIterator public to unbreak the gcc buildbots.
Jakob Stoklund Olesen [Wed, 30 May 2012 00:05:03 +0000 (00:05 +0000)]
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

12 years agoUse MCRegUnitIterator to compute regsOverlap().
Jakob Stoklund Olesen [Tue, 29 May 2012 23:40:02 +0000 (23:40 +0000)]
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

12 years agoEmit register unit lists for each register.
Jakob Stoklund Olesen [Tue, 29 May 2012 23:40:00 +0000 (23:40 +0000)]
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

12 years agobounds checking:
Nuno Lopes [Tue, 29 May 2012 22:32:51 +0000 (22:32 +0000)]
bounds checking:
 - hoist checks out of loops where SCEV is smart enough
 - add additional statistics to measure how much we loose for not supporting interprocedural and pointers loaded from memory

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157649 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDenseMap's move assignment operator needs to return *this
Douglas Gregor [Tue, 29 May 2012 20:33:09 +0000 (20:33 +0000)]
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

12 years agoOptional def can be either a def or a use (of reg0).
Evan Cheng [Tue, 29 May 2012 19:40:44 +0000 (19:40 +0000)]
Optional def can be either a def or a use (of reg0).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157640 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd intrinsics, code gen, assembler and disassembler support for the SSE4a extrq...
Benjamin Kramer [Tue, 29 May 2012 19:05:25 +0000 (19:05 +0000)]
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

12 years agoClear the entering, exiting and internal ranges of a bundle before collecting
Lang Hames [Tue, 29 May 2012 18:19:54 +0000 (18:19 +0000)]
Clear the entering, exiting and internal ranges of a bundle before collecting
ranges for the instruction about to be bundled. This fixes a bug in an external
project where an assertion was triggered due to spurious 'multiple defs' within
the bundle.

Patch by Ivan Llopard. Thanks Ivan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157632 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate CPPBackend to new API for AttrListPtr::get.
Nicolas Geoffray [Tue, 29 May 2012 15:07:18 +0000 (15:07 +0000)]
Update CPPBackend to new API for AttrListPtr::get.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157624 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
Stepan Dyatkovskiy [Tue, 29 May 2012 12:26:47 +0000 (12:26 +0000)]
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

12 years agoAdd llvm.fabs intrinsic.
Peter Collingbourne [Mon, 28 May 2012 21:48:37 +0000 (21:48 +0000)]
Add llvm.fabs intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157594 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix suspicous hasOneUse() check, found by PVS Studio (PR12357).
Benjamin Kramer [Mon, 28 May 2012 20:52:48 +0000 (20:52 +0000)]
Fix suspicous hasOneUse() check, found by PVS Studio (PR12357).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157592 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInstCombine: Fix infinite loop when encountering switch on trivial icmp.
Benjamin Kramer [Mon, 28 May 2012 19:18:16 +0000 (19:18 +0000)]
InstCombine: Fix infinite loop when encountering switch on trivial icmp.

The test case feeds the following into InstCombine's visitSelect:
%tobool8 = icmp ne i32 0, 0
%phitmp = select i1 %tobool8, i32 3, i32 0
Then instcombine replaces the right side of the switch with 0, doesn't notice
that nothing changes and tries again indefinitely.

This fixes PR12897.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157587 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unused variable.
David Blaikie [Mon, 28 May 2012 18:23:36 +0000 (18:23 +0000)]
Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157586 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR12696: Attribute bits above 1<<30 are not encoded in bitcode
Meador Inge [Mon, 28 May 2012 15:45:43 +0000 (15:45 +0000)]
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