Peter Collingbourne [Sun, 20 May 2012 01:32:09 +0000 (01:32 +0000)]
Do not pass an invalid domtree to SimplifyInstruction from
LoopUnswitch. Fixes PR12887.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157140
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 23:59:27 +0000 (23:59 +0000)]
Simplify overlap check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157137
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 23:34:59 +0000 (23:34 +0000)]
Fix 12892.
Dead code elimination during coalescing could cause a virtual register
to be split into connected components. The following rewriting would be
confused about the already joined copies present in the code, but
without a corresponding value number in the live range.
Erase all joined copies instantly when joining intervals such that the
MI and LiveInterval representations are always in sync.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157135
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Sat, 19 May 2012 22:52:10 +0000 (22:52 +0000)]
Do not eliminate allocas whose alignment exceeds that of the
copied-in constant, as a subsequent user may rely on over alignment.
Fixes PR12885.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157134
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 19 May 2012 21:52:55 +0000 (21:52 +0000)]
Add a FIXME about access to negative stack-pointer offsets on PPC32.
The current code will generate a prologue which starts with something like:
mflr 0
stw 31, -4(1)
stw 0, 4(1)
stwu 1, -16(1)
But under the PPC32 SVR4 ABI, access to negative offsets from R1 is not allowed.
This was pointed out by Peter Bergner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157133
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 21:02:31 +0000 (21:02 +0000)]
Remove the late DCE in RegisterCoalescer.
Dead code and joined copies are now eliminated on the fly, and there is
no need for a post pass.
This makes the coalescer work like other modern register allocator
passes: Code is changed on the fly, there is no pending list of changes
to be committed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157132
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 20:54:07 +0000 (20:54 +0000)]
Erase joined copies immediately.
The late dead code elimination is no longer necessary.
The test changes are cause by a register hint that can be either %rdi or
%rax. The choice depends on the use list order, which this patch changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157131
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 20:54:03 +0000 (20:54 +0000)]
Fix an ancient bug in removeCopyByCommutingDef().
Before rewriting uses of one value in A to register B, check that there
are no tied uses. That would require multiple A values to be rewritten.
This bug can't bite in the current version of the code for a fairly
subtle reason: A tied use would have caused 2-addr to insert a copy
before the use. If the copy has been coalesced, it will be found by the
same loop changed by this patch, and the optimization is aborted.
This was exposed by 400.perlbench and lua after applying a patch that
deletes joined copies aggressively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157130
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sat, 19 May 2012 20:30:08 +0000 (20:30 +0000)]
On Haswell, perfer storing YMM registers using a single instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157129
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sat, 19 May 2012 19:57:37 +0000 (19:57 +0000)]
Add support for additional in-reg vbroadcast patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157127
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 19:32:11 +0000 (19:32 +0000)]
Disambiguate call to operator==.
clang++ and msvc happily had no problem with it but g++ refuses to compile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157126
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 19:25:00 +0000 (19:25 +0000)]
Collect inflatable virtual registers on the fly.
There is no reason to defer the collection of virtual registers whose
register class may be replaced with a larger class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157125
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 19:15:32 +0000 (19:15 +0000)]
ValueMap: Use DenseMap's find_as mechanism to reduce use list churn.
Otherwise just looking up a value in the map requires creating a VH, adding it to the use lists and destroying it again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157124
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 19:15:25 +0000 (19:15 +0000)]
Move CallbackVHs dtor inline, it can be devirtualized in many cases. Move the other virtual methods out of line as they are only called from within Value.cpp anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157123
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 19 May 2012 19:14:18 +0000 (19:14 +0000)]
Tidy up some spacing and inconsistent use of pre/post increment. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157122
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 16:44:12 +0000 (16:44 +0000)]
Remove extra semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157118
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 13:28:54 +0000 (13:28 +0000)]
Provide move semantics for TinyPtrVector and for DenseMap's rehash function.
This makes DenseMap<..., TinyPtrVector<...>> as cheap as it always should've been!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157113
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sat, 19 May 2012 13:14:30 +0000 (13:14 +0000)]
Ordinary PR1255 patch: DifferenceEngine and CPPBackend adopted to the new SwitchInst methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157112
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 19 May 2012 08:28:17 +0000 (08:28 +0000)]
Copy some AVX support from MCJIT to JIT. Maybe will fix PR12748.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157109
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:59 +0000 (05:25 +0000)]
Eliminate dead code after remat.
This will remove the original def once it has no more uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157104
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:56 +0000 (05:25 +0000)]
Don't remat during updateRegDefsUses().
Remaining virtreg->physreg copies were rematerialized during
updateRegDefsUses(), but we already do the same thing in joinCopy() when
visiting the physreg copy instruction.
Eliminate the preserveSrcInt argument to reMaterializeTrivialDef(). It
is now always true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157103
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:53 +0000 (05:25 +0000)]
Immediately erase trivially useless copies.
There is no need for these instructions to stick around since they are
known to be not dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157102
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:50 +0000 (05:25 +0000)]
Run proper recursive dead code elimination during coalescing.
Dead copies cause problems because they are trivial to coalesce, but
removing them gived the live range a dangling end point. This patch
enables full dead code elimination which trims live ranges to their uses
so end points don't dangle.
DCE may erase multiple instructions. Put the pointers in an ErasedInstrs
set so we never risk visiting erased instructions in the work list.
There isn't supposed to be any dead copies entering RegisterCoalescer,
but they do slip by as evidenced by test/CodeGen/X86/coalescer-dce.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157101
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:46 +0000 (05:25 +0000)]
Allow LiveRangeEdit to be created with a NULL parent.
The dead code elimination with callbacks is still useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157100
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 19 May 2012 01:36:37 +0000 (01:36 +0000)]
Actually support DW_TAG_rvalue_reference_type that we were trying
to generate out of the front end.
rdar://
11479676
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157094
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 19 May 2012 00:51:56 +0000 (00:51 +0000)]
Add support for the 'd' mips inline asm output modifier.
Patch by Jack Carter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157093
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Sat, 19 May 2012 00:48:25 +0000 (00:48 +0000)]
SCEV: Add MarkPendingLoopPredicates to avoid recursive isImpliedCond.
getUDivExpr attempts to simplify by checking for overflow.
isLoopEntryGuardedByCond then evaluates the loop predicate which
may lead to the same getUDivExpr causing endless recursion.
Fixes PR12868: clang 3.2 segmentation fault.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157092
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Fri, 18 May 2012 22:17:29 +0000 (22:17 +0000)]
Fix replacing all the users of objc weak runtime routines
when deleting them. rdar://
11434915.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157080
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 18 May 2012 22:10:15 +0000 (22:10 +0000)]
Modernize naming convention for class members.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157079
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 18 May 2012 21:09:40 +0000 (21:09 +0000)]
Move all work list processing to copyCoalesceWorkList().
This will make it possible to filter out erased instructions later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157073
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Fri, 18 May 2012 21:02:10 +0000 (21:02 +0000)]
allow LazyValueInfo::getEdgeValue() to reason about multiple edges from the same switch instruction by doing union of ranges (which may still be conservative, but it's more aggressive than before)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157071
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 18 May 2012 19:12:01 +0000 (19:12 +0000)]
Refactor data-in-code annotations.
Use a dedicated MachO load command to annotate data-in-code regions.
This is the same format the linker produces for final executable images,
allowing consistency of representation and use of introspection tools
for both object and executable files.
Data-in-code regions are annotated via ".data_region"/".end_data_region"
directive pairs, with an optional region type.
data_region_directive := ".data_region" { region_type }
region_type := "jt8" | "jt16" | "jt32" | "jta32"
end_data_region_directive := ".end_data_region"
The previous handling of ARM-style "$d.*" labels was broken and has
been removed. Specifically, it didn't handle ARM vs. Thumb mode when
marking the end of the section.
rdar://
11459456
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157062
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Kledzik [Fri, 18 May 2012 18:39:06 +0000 (18:39 +0000)]
fix warnings when compiling with -Wshadow
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157061
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 18 May 2012 18:24:15 +0000 (18:24 +0000)]
Remove duplicate code that we could just fallthrough to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157060
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 18 May 2012 18:21:48 +0000 (18:21 +0000)]
Simplify RegisterCoalescer::copyCoalesceInMBB().
It is no longer necessary to separate VirtCopies, PhysCopies, and
ImpDefCopies. Implicitly defined copies are extremely rare after we
added the ProcessImplicitDefs pass, and physical register copies are not
joined any longer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157059
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Fri, 18 May 2012 17:44:58 +0000 (17:44 +0000)]
add test case for bugfix in r157032
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157058
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 18 May 2012 17:39:35 +0000 (17:39 +0000)]
Add support for the mips 'x' inline asm modifier.
Patch by Jack Carter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157057
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 18 May 2012 17:18:58 +0000 (17:18 +0000)]
Remove support for PhysReg joining.
This has been disabled for a while, and it is not a feature we want to
support. Copies between physical and virtual registers are eliminated by
good hinting support in the register allocator. Joining virtual and
physical registers is really a form of register allocation, and the
coalescer is not properly equipped to do that. In particular, it cannot
backtrack coalescing decisions, and sometimes that would cause it to
create programs that were impossible to register allocate, by exhausting
a small register class.
It was also very difficult to keep track of the live ranges of aliasing
registers when extending the live range of a physreg. By disabling
physreg joining, we can let fixed physreg live ranges remain constant
throughout the register allocator super-pass.
One type of physreg joining remains: A virtual register that has a
single value which is a copy of a reserved register can be merged into
the reserved physreg. This always lowers register pressure, and since we
don't compute live ranges for reserved registers, there are no problems
with aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157055
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel Jones [Fri, 18 May 2012 16:24:01 +0000 (16:24 +0000)]
FileCheck-ify, apropos of nothing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157051
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Fri, 18 May 2012 08:32:28 +0000 (08:32 +0000)]
Recommited reworked r156804:
SelectionDAGBuilder::Clusterify : main functinality was replaced with CRSBuilder::optimize, so big part of Clusterify's code was reduced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157046
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 18 May 2012 07:07:36 +0000 (07:07 +0000)]
Simplify code a bit. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157044
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 18 May 2012 06:42:06 +0000 (06:42 +0000)]
Simplify handling of v16i8 shuffles and fix a missed optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157043
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 18 May 2012 01:33:51 +0000 (01:33 +0000)]
Teach two-address pass to update the "source" map so it doesn't perform a
non-profitable commute using outdated info. The test case would still fail
because of poor pre-RA schedule. That will be fixed by MI scheduler.
rdar://
11472010
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157038
91177308-0d34-0410-b5e6-
96231b3b80d8
Danil Malyshev [Fri, 18 May 2012 00:30:58 +0000 (00:30 +0000)]
Temporarily disabled the MCJIT tests for Darwin, because the RuntimeDyldMachO has a problems with relocations for 32bit x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157035
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 18 May 2012 00:16:22 +0000 (00:16 +0000)]
Clarify comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157033
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Fri, 18 May 2012 00:14:36 +0000 (00:14 +0000)]
fix corner case in ConstantRange::intersectWith().
this fixes the missed optimization I was seeing in the CorrelatedValuePropagation pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157032
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Fri, 18 May 2012 00:13:56 +0000 (00:13 +0000)]
Fixed a bug in llvm-objdump when disassembling using -macho option for a binary
containing no symbols. Fixed the crash and fixed it not disassembling anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157031
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 18 May 2012 00:07:14 +0000 (00:07 +0000)]
Remove a test that was only testing for physreg joining.
This is the same as the other tests: Clever tricks are required to make
the arguments and return value line up in a single-instruction function.
It rarely happens in real life.
We have plenty other examples of this behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157030
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 17 May 2012 23:44:19 +0000 (23:44 +0000)]
Remove -join-physregs from the test suite.
This option has been disabled for a while, and it is going away so I can
clean up the coalescer code.
The tests that required physreg joining to be enabled were almost all of
the form "tiny function with interference between arguments and return
value". Such functions are usually inlined in the real world.
The problem exposed by phys_subreg_coalesce-3.ll is real, but fairly
rare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157027
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Thu, 17 May 2012 23:04:08 +0000 (23:04 +0000)]
minor simplification in the call to ConstantRange constructor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157024
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 17 May 2012 22:37:09 +0000 (22:37 +0000)]
comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157020
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 17 May 2012 22:18:01 +0000 (22:18 +0000)]
Fix the encoding of the armv7m (MClass) for MSR APSR writes which was missing
the 0b10 mask encoding bits. Make MSR APSR writes without a _<bits> qualifier
an alias for MSR APSR_nzcvq even though ARM as deprecated it use. Also add
support for suffixes (_nzcvq, _g, _nzcvqg) for APSR versions. Some FIXMEs in
the code for better error checking when versions shouldn't be used.
rdar://
11457025
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157019
91177308-0d34-0410-b5e6-
96231b3b80d8
Danil Malyshev [Thu, 17 May 2012 21:07:47 +0000 (21:07 +0000)]
- Added ExecutionEngine/MCJIT tests
- Added HOST_ARCH to Makefile.config.in
The HOST_ARCH will be used by MCJIT tests filter, because MCJIT supported only x86 and ARM architectures now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157015
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 17 May 2012 20:27:58 +0000 (20:27 +0000)]
Remove extraneous ';'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157011
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 17 May 2012 18:35:13 +0000 (18:35 +0000)]
misched: trace ReadyQ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157007
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 17 May 2012 18:35:10 +0000 (18:35 +0000)]
misched: Added 3-level regpressure back-off.
Introduce the basic strategy for register pressure scheduling.
1) Respect target limits at all times.
2) Indentify critical register classes (pressure sets).
Track pressure within the scheduled region.
Avoid increasing scheduled pressure for critical registers.
3) Avoid exceeding the max pressure of the region prior to scheduling.
Added logic for picking between the top and bottom ready Q's based on
regpressure heuristics.
Status: functional but needs to be asjusted to achieve good results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157006
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 17 May 2012 18:35:07 +0000 (18:35 +0000)]
comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157005
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 17 May 2012 18:35:05 +0000 (18:35 +0000)]
regpressure: Fix getMaxUpwardPressureDelta.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157004
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 17 May 2012 18:35:03 +0000 (18:35 +0000)]
misched: fix liveness iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157003
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 17 May 2012 18:35:00 +0000 (18:35 +0000)]
whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157002
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 17 May 2012 18:32:42 +0000 (18:32 +0000)]
Never clear <undef> flags on already joined copies.
RegisterCoalescer set <undef> flags on all operands of copy instructions
that are scheduled to be removed. This is so they won't affect
shrinkToUses() by introducing false register reads.
Make sure those <undef> flags are never cleared, or shrinkToUses() could
cause live intervals to end at instructions about to be deleted.
This would be a lot simpler if RegisterCoalescer could just erase joined
copies immediately instead of keeping all the to-be-deleted instructions
around.
This fixes PR12862. Unfortunately, bugpoint can't create a sane test
case for this. Like many other coalescer problems, this failure depends
of a very fragile series of events.
<rdar://problem/
11474428>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157001
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 17 May 2012 18:32:40 +0000 (18:32 +0000)]
Fix a verifier bug.
Make sure useless (def-only) intervals also get verified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157000
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 17 May 2012 17:59:51 +0000 (17:59 +0000)]
Relax the requirement that the exception object must be an instruction. During
bugpoint-ing, it may turn into something else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156998
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Thu, 17 May 2012 16:46:46 +0000 (16:46 +0000)]
[Hexagon] Clean up Hexagon ELF definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156996
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 17 May 2012 15:55:41 +0000 (15:55 +0000)]
enhance the intrinsic info stuff to emit encodings that don't fit in 32-bits into a
separate side table, using the handy SequenceToOffsetTable class. This encodes all
these weird things into another 256 bytes, allowing all intrinsics to be encoded this way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156995
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 17 May 2012 13:12:13 +0000 (13:12 +0000)]
Remove incorrect pattern for ARM SMML instruction.
Patch by Meador Inge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156989
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Thu, 17 May 2012 09:32:05 +0000 (09:32 +0000)]
Fix compile error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156986
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Thu, 17 May 2012 08:56:30 +0000 (08:56 +0000)]
SelectionDAGBuilder: CaseBlock, CaseRanges and CaseCmp changed representation of Low and High from signed to unsigned. Since unsigned ints usually simpler, faster and allows to reduce some extra signed bit checks needed before <,>,<=,>= comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156985
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 17 May 2012 05:13:57 +0000 (05:13 +0000)]
Genericize the intrinsics descriptor decoding a bit to make room
for future expansion, no functionality change yet though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156979
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 17 May 2012 05:03:24 +0000 (05:03 +0000)]
finish encoding all of the interesting details of intrinsics. Now intrinsics
are only rejected because they can't be encoded into a 32-bit unit, not because
they contain an unencodable feature.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156978
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 17 May 2012 04:30:58 +0000 (04:30 +0000)]
strengthen the intrinsic descriptor stuff to be able to handle sin, cos and other
intrinsics that use passed-in arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156977
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 17 May 2012 04:07:48 +0000 (04:07 +0000)]
simplify code generated by tblgen that is not necessary since we dropped
compatibility with LLVM 2.x bitcode files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156976
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Thu, 17 May 2012 04:00:03 +0000 (04:00 +0000)]
I forgot the #ifdef _MSC_VER guard in my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156975
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Thu, 17 May 2012 03:38:19 +0000 (03:38 +0000)]
Fix the MSVC 2010 build: disable the optimizer for a problematic function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156973
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 16 May 2012 23:03:04 +0000 (23:03 +0000)]
Use RegUnits to compute overlapping registers.
TableGen already computes register units as the basic unit of
interference. We can use that to compute the set of overlapping
registers.
This means that we can easily compute overlap sets for one register at a
time. There is no benefit to computing all registers at once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156960
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 16 May 2012 22:19:56 +0000 (22:19 +0000)]
This patch adds the register class for MIPS16 as well as the ability for
llc to recognize MIPS16 as a MIPS ASE extension. -mips16 will mean the
mips16 ASE for mips32 by default.
As part of fixing of adding this we discovered some small changes that
need to be made to MipsInstrInfo::storeRegToStackSLot and
MipsInstrInfo::loadRegFromStackSlot. We were using some "==" equality tests
where in fact we should have been using Mips::<regclas>.hasSubClassEQ instead,
per suggestion of Jakob Stoklund Olesen.
Patch by Reed Kotler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156958
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 16 May 2012 22:08:58 +0000 (22:08 +0000)]
Grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156955
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 16 May 2012 21:22:35 +0000 (21:22 +0000)]
Set sub-register <undef> flags more accurately.
When widening an existing <def,reads-undef> operand to a super-register,
it may be necessary to clear the <undef> flag because the wider register
is now read-modify-write through the instruction.
Conversely, it may be necessary to add an <undef> flag when the
coalescer turns a full-register def into a sub-register def, but the
larger register wasn't live before the instruction.
This happens in test/CodeGen/ARM/coalesce-subregs.ll, but the test
is too small for the <undef> flags to affect the generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156951
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Wed, 16 May 2012 19:07:55 +0000 (19:07 +0000)]
Disable JITTest.FunctionIsRecompiledAndRelinked and JITTest.NoStubs
on MIPS where they are not implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156935
91177308-0d34-0410-b5e6-
96231b3b80d8
Danil Malyshev [Wed, 16 May 2012 18:50:11 +0000 (18:50 +0000)]
Added LLIMCJITMemoryManager to the lli. This manager will be used for MCJIT instead of DefaultJIMMemoryManager.
It's more flexible for MCJIT tasks, in addition it's provides a invalidation instruction cache for code sections which will be used before JIT code will be executed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156933
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 16 May 2012 15:03:55 +0000 (15:03 +0000)]
Hexagon: Remove unused command line option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156917
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 16 May 2012 12:25:43 +0000 (12:25 +0000)]
I noticed that named metadata doesn't provide a direct way of getting at the
named metadata list, unlike all the other global objects (global variables,
functions, aliases), so add that for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156915
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 16 May 2012 08:32:49 +0000 (08:32 +0000)]
Teach the 'opt' tool about '-Os' and '-Oz', corresponding to the Clang
options, to enable easier testing of the innards of LLVM that are
enabled by such optimization strategies.
Note that this doesn't provide the (much needed) function attribute
support for -Oz (as opposed to -Os), but still seems like a positive
step to better test the logic that Clang currently relies on.
Patch by Patrik Hägglund.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156913
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 16 May 2012 07:57:18 +0000 (07:57 +0000)]
Fix a thinko in DisintegrateMERGE_VALUES. Patch by Xiaoyi Guo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156909
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 16 May 2012 06:34:44 +0000 (06:34 +0000)]
Significantly reduce the compiled size of Functions.cpp by turning a big blob of tblgen
generated code (for Intrinsic::getType) into a table. This handles common cases right now,
but I plan to extend it to handle all cases and merge in type verification logic as well
in follow-on patches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156905
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 16 May 2012 04:51:09 +0000 (04:51 +0000)]
have tblgen emit cast<> instead of dyn_cast<> when we know it must succeed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156902
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 16 May 2012 01:54:27 +0000 (01:54 +0000)]
Avoid creating a cycle when folding load / op with flag / store. PR11451474. rdar://
11451474
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156896
91177308-0d34-0410-b5e6-
96231b3b80d8
John Criswell [Wed, 16 May 2012 00:26:51 +0000 (00:26 +0000)]
Fixed grammar for the llvm.trap intrinsic description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156881
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 15 May 2012 23:31:35 +0000 (23:31 +0000)]
Enable sub-sub-register copy coalescing.
It is now possible to coalesce weird skewed sub-register copies by
picking a super-register class larger than both original registers. The
included test case produces code like this:
vld2.32 {d16, d17, d18, d19}, [r0]!
vst2.32 {d18, d19, d20, d21}, [r0]
We still perform interference checking as if it were a normal full copy
join, so this is still quite conservative. In particular, the f1 and f2
functions in the included test case still have remaining copies because
of false interference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156878
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 15 May 2012 22:26:28 +0000 (22:26 +0000)]
Teach RegisterCoalescer to handle symmetric sub-register copies.
It is possible to coalesce two overlapping registers to a common
super-register that it larger than both of the original registers.
The important difference is that it may be necessary to rewrite DstReg
operands as well as SrcReg operands because the sub-register index has
changed.
This behavior is still disabled by CoalescerPair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156869
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 15 May 2012 22:20:27 +0000 (22:20 +0000)]
Handle NewReg==OldReg in renameRegister().
This can happen when widening a virtual register to a super-register
class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156867
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 15 May 2012 22:18:49 +0000 (22:18 +0000)]
We never call adjustCopiesBackFrom() for partial copies.
There is no need to look at an always null SrcIdx.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156866
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 15 May 2012 22:07:18 +0000 (22:07 +0000)]
llvm-config: Use sys::fs::equivalent instead of string comparison.
- Hopefully fixes PR11600 (untested).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156865
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 15 May 2012 22:07:14 +0000 (22:07 +0000)]
[Support] Add a version of sys::fs::equivalent() that treats errors as false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156864
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 15 May 2012 21:32:27 +0000 (21:32 +0000)]
[docs] Remove unsupported references to ExtraSource variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156857
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 15 May 2012 20:47:23 +0000 (20:47 +0000)]
Add blurb for Crack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156852
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 15 May 2012 20:20:50 +0000 (20:20 +0000)]
Add a test case for r156840, a fix to llvm-objdump when disassembling using
-macho to disassemble the last symbol to the end of the section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156850
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Tue, 15 May 2012 20:20:14 +0000 (20:20 +0000)]
reuse the result of some expensive computations in getSignExtendExpr() and getZeroExtendExpr()
this gives a speedup of > 80 in a debug build in the test case of PR12825 (php_sha512_crypt_r)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156849
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 15 May 2012 20:09:43 +0000 (20:09 +0000)]
Extend the CoalescerPair interface to handle symmetric sub-register copies.
Now both SrcReg and DstReg can be sub-registers of the final coalesced
register.
CoalescerPair::setRegisters still rejects such copies because
RegisterCoalescer doesn't yet handle them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156848
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 15 May 2012 20:06:41 +0000 (20:06 +0000)]
Update MIPS' section in the release notes. Patch by Simon Atanasyan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156847
91177308-0d34-0410-b5e6-
96231b3b80d8