oota-llvm.git
13 years agoBack out r130862; it appears to be breaking bootstrap.
Eli Friedman [Wed, 4 May 2011 20:48:42 +0000 (20:48 +0000)]
Back out r130862; it appears to be breaking bootstrap.

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

13 years agoTeach MachineCSE how to do simple cross-block CSE involving physregs. This allows...
Eli Friedman [Wed, 4 May 2011 19:54:24 +0000 (19:54 +0000)]
Teach MachineCSE how to do simple cross-block CSE involving physregs.  This allows, for example, eliminating duplicate cmpl's on x86. Part of rdar://problem/8259436 .

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

13 years agoRemove an unused variable.
Duncan Sands [Wed, 4 May 2011 19:13:01 +0000 (19:13 +0000)]
Remove an unused variable.

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

13 years agoFix more register and coalescing dependencies.
Jakob Stoklund Olesen [Wed, 4 May 2011 19:02:11 +0000 (19:02 +0000)]
Fix more register and coalescing dependencies.

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

13 years agoExplicitly request physreg coalesing for a bunch of Thumb2 unit tests.
Jakob Stoklund Olesen [Wed, 4 May 2011 19:02:07 +0000 (19:02 +0000)]
Explicitly request physreg coalesing for a bunch of Thumb2 unit tests.

These tests all follow the same pattern:

mov r2, r0
movs r0, #0
$CMP r2, r1
it eq
moveq r0, #1
bx lr

The first 'mov' can be eliminated by rematerializing 'movs r0, #0' below the
test instruction:

$CMP r0, r1
mov.w r0, #0
it eq
moveq r0, #1
bx lr

So far, only physreg coalescing can do that. The register allocators won't yet
split live ranges just to eliminate copies. They can learn, but this particular
problem is not likely to show up in real code. It only appears because r0 is
used for both the function argument and return value.

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

13 years agoImplement SystemZRegisterInfo::getMatchingSuperRegClass to enable cross-class joins.
Jakob Stoklund Olesen [Wed, 4 May 2011 19:02:04 +0000 (19:02 +0000)]
Implement SystemZRegisterInfo::getMatchingSuperRegClass to enable cross-class joins.

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

13 years agoFileCheckize and break dependence on coalescing order.
Jakob Stoklund Olesen [Wed, 4 May 2011 19:02:01 +0000 (19:02 +0000)]
FileCheckize and break dependence on coalescing order.

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

13 years agoExplicitly request -join-physregs for some tests that depend on it.
Jakob Stoklund Olesen [Wed, 4 May 2011 19:01:59 +0000 (19:01 +0000)]
Explicitly request -join-physregs for some tests that depend on it.

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

13 years agoDo not emit location expression size twice.
Devang Patel [Wed, 4 May 2011 19:00:57 +0000 (19:00 +0000)]
Do not emit location expression size twice.

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

13 years agoFix cmake build.
Rafael Espindola [Wed, 4 May 2011 18:46:56 +0000 (18:46 +0000)]
Fix cmake build.

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

13 years agoRemove LLVM IR metadata in test case committed in r130847.
Akira Hatanaka [Wed, 4 May 2011 18:28:36 +0000 (18:28 +0000)]
Remove LLVM IR metadata in test case committed in r130847.

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

13 years agoPrevent instructions using $gp from being placed between a jalr and the instruction...
Akira Hatanaka [Wed, 4 May 2011 17:54:27 +0000 (17:54 +0000)]
Prevent instructions using $gp from being placed between a jalr and the instruction that restores the clobbered $gp.

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

13 years agoProducing a DW_FORM_addr for DW_AT_stmt_list is probably correct, but
Rafael Espindola [Wed, 4 May 2011 17:44:06 +0000 (17:44 +0000)]
Producing a DW_FORM_addr for DW_AT_stmt_list is probably correct, but
it is both inefficient and unexpected by dwarfdump. Change to
a DW_FORM_data4.

While in here, change the predicate name to reflect that the position
is not really absolute (it is an offset), just that the linker needs a
relocation.

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

13 years agoRename -disable-physical-join to -join-physregs and invert it.
Jakob Stoklund Olesen [Wed, 4 May 2011 16:45:05 +0000 (16:45 +0000)]
Rename -disable-physical-join to -join-physregs and invert it.

Physreg joining is still on by default, but I will turn it off shortly.

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

13 years agoTighten up check for empty (i.e. no meaningful debug info) module. This fixes dwarf...
Devang Patel [Wed, 4 May 2011 16:34:02 +0000 (16:34 +0000)]
Tighten up check for empty (i.e. no meaningful debug info) module. This fixes dwarf-die2.c test case from gcc test suite.

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

13 years agoAdd variations on: max(x,y) >= min(x,z) folds to true. This isn't that common,
Duncan Sands [Wed, 4 May 2011 16:05:05 +0000 (16:05 +0000)]
Add variations on: max(x,y) >= min(x,z) folds to true.  This isn't that common,
but according to my super-optimizer there are only two missed simplifications
of -instsimplify kind when compiling bzip2, and this is one of them.  It amuses
me to have bzip2 be perfectly optimized as far as instsimplify goes!

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

13 years agoEmit gcov data files to the directory specified in the metadata produced by the
Nick Lewycky [Wed, 4 May 2011 04:03:04 +0000 (04:03 +0000)]
Emit gcov data files to the directory specified in the metadata produced by the
frontend, if applicable.

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

13 years agoFix crash when not setting GCOV_PREFIX.
Nick Lewycky [Wed, 4 May 2011 03:58:45 +0000 (03:58 +0000)]
Fix crash when not setting GCOV_PREFIX.

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

13 years agoRemove dead intrinsics.
Bill Wendling [Wed, 4 May 2011 02:40:54 +0000 (02:40 +0000)]
Remove dead intrinsics.

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

13 years agoindvars: Added DisableIVRewrite and WidenIVs.
Andrew Trick [Wed, 4 May 2011 02:10:13 +0000 (02:10 +0000)]
indvars: Added DisableIVRewrite and WidenIVs.

This adds functionality to remove size/zero extension during indvars
without generating a canonical IV and rewriting all IV users. It's
disabled by default so should have no effect on codegen. Work in progress.

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

13 years agoThe system suppression file should catch these, but since they *once again* are
Nick Lewycky [Wed, 4 May 2011 01:03:02 +0000 (01:03 +0000)]
The system suppression file should catch these, but since they *once again* are
not, I'll just add them here and be done with it.

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

13 years agoDon't depend on the physreg coalescing order.
Jakob Stoklund Olesen [Wed, 4 May 2011 01:01:47 +0000 (01:01 +0000)]
Don't depend on the physreg coalescing order.

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

13 years agoDon't run this test through -regalloc=basic.
Jakob Stoklund Olesen [Wed, 4 May 2011 01:01:44 +0000 (01:01 +0000)]
Don't run this test through -regalloc=basic.

The basic allocator is really bad about hinting, so it doesn't eliminate all
copies when physreg joining is disabled.

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

13 years agoFix register-dependent XCore tests
Jakob Stoklund Olesen [Wed, 4 May 2011 01:01:41 +0000 (01:01 +0000)]
Fix register-dependent XCore tests

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

13 years agoFix register-dependent test in MSP430.
Jakob Stoklund Olesen [Wed, 4 May 2011 01:01:39 +0000 (01:01 +0000)]
Fix register-dependent test in MSP430.

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

13 years agoImplement MSP430RegisterInfo::getMatchingSuperRegClass to enable cross-class
Jakob Stoklund Olesen [Wed, 4 May 2011 01:01:36 +0000 (01:01 +0000)]
Implement MSP430RegisterInfo::getMatchingSuperRegClass to enable cross-class
coalescing.

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

13 years agoRemove some random comments that snuck in from somewhere.
Eric Christopher [Wed, 4 May 2011 00:48:02 +0000 (00:48 +0000)]
Remove some random comments that snuck in from somewhere.

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

13 years agoMark ultra-super-registers QQQQ as call-clobbered instead of the D sub-registers.
Jakob Stoklund Olesen [Tue, 3 May 2011 22:31:24 +0000 (22:31 +0000)]
Mark ultra-super-registers QQQQ as call-clobbered instead of the D sub-registers.

LiveVariables doesn't understand that clobbering D0 and D1 completely overwrites
Q0, so if Q0 is live-in to a function, its live range will extend beyond a
function call that only clobbers D0 and D1. This shows up in the
ARM/2009-11-01-NeonMoves test case.

LiveVariables should probably implement the much stricter rules for physreg
liveness that RAFast imposes - a physreg is killed by the first use of any
alias.

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

13 years agoFix a bunch of ARM tests to be register allocation independent.
Jakob Stoklund Olesen [Tue, 3 May 2011 22:31:21 +0000 (22:31 +0000)]
Fix a bunch of ARM tests to be register allocation independent.

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

13 years agoindvars: Added canExpandBackEdgeTakenCount.
Andrew Trick [Tue, 3 May 2011 22:24:10 +0000 (22:24 +0000)]
indvars: Added canExpandBackEdgeTakenCount.

Only create a canonical IV for backedge taken count if it will
actually be used by LinearFunctionTestReplace. And some related
cleanup, preparing to reduce dependence on canonical IVs.
No significant effect on x86 or arm in the test-suite.

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

13 years agoEven if the subprogram is going to use AT_specification, emit DW_AT_MIPS_linkage_name...
Devang Patel [Tue, 3 May 2011 21:50:34 +0000 (21:50 +0000)]
Even if the subprogram is going to use AT_specification, emit DW_AT_MIPS_linkage_name. This helps gdb and fixes var-path-expr.exp regression reported by gdb testsuite.

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

13 years agoMCDwarf: Don't save Twine to local variable, this is almost never safe to do
Daniel Dunbar [Tue, 3 May 2011 21:33:37 +0000 (21:33 +0000)]
MCDwarf: Don't save Twine to local variable, this is almost never safe to do
(and should thus never be done).
 - Should fix a crash on win32.

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

13 years agoReplace the "movnt" intrinsics with a native store + nontemporal metadata bit.
Bill Wendling [Tue, 3 May 2011 21:11:17 +0000 (21:11 +0000)]
Replace the "movnt" intrinsics with a native store + nontemporal metadata bit.
<rdar://problem/8460511>

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

13 years agoGracefully handle invalid live ranges. Fix PR9831.
Jakob Stoklund Olesen [Tue, 3 May 2011 20:42:13 +0000 (20:42 +0000)]
Gracefully handle invalid live ranges. Fix PR9831.

Register coalescing can sometimes create live ranges that end in the middle of a
basic block without any killing instruction. When SplitKit detects this, it will
repair the live range by shrinking it to its uses.

Live range splitting also needs to know about this. When the range shrinks so
much that it becomes allocatable, live range splitting fails because it can't
find a good split point. It is paranoid about making progress, so an allocatable
range is considered an error.

The coalescer should really not be creating these bad live ranges. They appear
when coalescing dead copies.

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

13 years agoImplement some basic simplifications involving min/max, for example
Duncan Sands [Tue, 3 May 2011 19:53:10 +0000 (19:53 +0000)]
Implement some basic simplifications involving min/max, for example
max(a,b) >= a -> true.  According to my super-optimizer, these are
by far the most common simplifications (of the -instsimplify kind)
that occur in the testsuite and aren't caught by -std-compile-opts.

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

13 years agoTidy up. Add missing newline to generated file.
Jim Grosbach [Tue, 3 May 2011 19:09:56 +0000 (19:09 +0000)]
Tidy up. Add missing newline to generated file.

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

13 years agoMake the test less likely to fail with minor changes.
Evan Cheng [Tue, 3 May 2011 19:09:32 +0000 (19:09 +0000)]
Make the test less likely to fail with minor changes.

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

13 years agoFix function MipsRegisterInfo::getRegisterNumbering.
Akira Hatanaka [Tue, 3 May 2011 18:41:54 +0000 (18:41 +0000)]
Fix function  MipsRegisterInfo::getRegisterNumbering.

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

13 years agoRemove test for iOS divmod function, since that is disabled for now.
Bob Wilson [Tue, 3 May 2011 17:54:49 +0000 (17:54 +0000)]
Remove test for iOS divmod function, since that is disabled for now.

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

13 years agoTemporarily disable use of divmod compiler-rt functions for iOS.
Bob Wilson [Tue, 3 May 2011 17:33:22 +0000 (17:33 +0000)]
Temporarily disable use of divmod compiler-rt functions for iOS.

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

13 years agoFold ARM coprocessor intrinsics patterns into the instructions defs whenever
Bruno Cardoso Lopes [Tue, 3 May 2011 17:29:29 +0000 (17:29 +0000)]
Fold ARM coprocessor intrinsics patterns into the instructions defs whenever
it's possible.

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

13 years agoAdd a few ARM coprocessor intrinsics. Testcases included
Bruno Cardoso Lopes [Tue, 3 May 2011 17:29:22 +0000 (17:29 +0000)]
Add a few ARM coprocessor intrinsics. Testcases included

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

13 years agoFix a comment.
Bob Wilson [Tue, 3 May 2011 17:22:56 +0000 (17:22 +0000)]
Fix a comment.

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

13 years agoIf the front end has emitted llvm.dbg.cu and other debug info anchors (clang does...
Devang Patel [Tue, 3 May 2011 16:45:22 +0000 (16:45 +0000)]
If the front end has emitted llvm.dbg.cu and other debug info anchors (clang does it now) then use them directly. This saves one scan of entire module, to collect debug info, which in turns saves few machine cycles at compile time.

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

13 years agoUse llvm.dbg.cu named metadata to collect compile units.
Devang Patel [Tue, 3 May 2011 16:18:28 +0000 (16:18 +0000)]
Use llvm.dbg.cu  named metadata to collect compile units.

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

13 years agoRemove unused variables caught by GCC's -Wunused-but-set-variable.
Benjamin Kramer [Tue, 3 May 2011 16:00:27 +0000 (16:00 +0000)]
Remove unused variables caught by GCC's -Wunused-but-set-variable.

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

13 years agoPass --disable-cfi to llc.
Rafael Espindola [Tue, 3 May 2011 15:56:16 +0000 (15:56 +0000)]
Pass --disable-cfi to llc.

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

13 years agoAdd pentium{3,4}m cpus. Patch by Alexander Best!
Michael J. Spencer [Tue, 3 May 2011 03:42:50 +0000 (03:42 +0000)]
Add pentium{3,4}m cpus. Patch by Alexander Best!

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

13 years agoxmm0 is an implicit parameter in this and so shouldn't be in the
Eric Christopher [Tue, 3 May 2011 01:28:32 +0000 (01:28 +0000)]
xmm0 is an implicit parameter in this and so shouldn't be in the
string template.

Fixes rdar://8493866

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

13 years agoAdd an unfolded offset field to LSR's Formula record. This is used to
Dan Gohman [Tue, 3 May 2011 00:46:49 +0000 (00:46 +0000)]
Add an unfolded offset field to LSR's Formula record. This is used to
model constants which can be added to base registers via add-immediate
instructions which don't require an additional register to materialize
the immediate.

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

13 years agoOther parts of the SelectionDAG framework assume that targets use their pointer type...
Owen Anderson [Mon, 2 May 2011 22:25:45 +0000 (22:25 +0000)]
Other parts of the SelectionDAG framework assume that targets use their pointer type for vector indices.  Make the vector unrolling code respect that.

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

13 years agoScanning entire basic block may be too expensive in terms of compile time. Instead...
Devang Patel [Mon, 2 May 2011 21:57:00 +0000 (21:57 +0000)]
Scanning entire basic block may be too expensive in terms of compile time. Instead, just use whatever location info first non-phi instruction has.

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

13 years agoHandle <def,undef> in the second loop as well.
Jakob Stoklund Olesen [Mon, 2 May 2011 20:36:53 +0000 (20:36 +0000)]
Handle <def,undef> in the second loop as well.

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

13 years agoApparently the check for direct calls is unnecessary.
Eric Christopher [Mon, 2 May 2011 20:16:33 +0000 (20:16 +0000)]
Apparently the check for direct calls is unnecessary.

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

13 years agoUse the PrintReg adaptor to correctly print live-in registers in debug output.
Jakob Stoklund Olesen [Mon, 2 May 2011 20:06:30 +0000 (20:06 +0000)]
Use the PrintReg adaptor to correctly print live-in registers in debug output.

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

13 years agoOnly ignore <undef> use operands, keep the <def,undef> ops.
Jakob Stoklund Olesen [Mon, 2 May 2011 20:06:28 +0000 (20:06 +0000)]
Only ignore <undef> use operands, keep the <def,undef> ops.

Def operands may also have an <undef> flag, but that just means that a
sub-register redef doesn't actually read the super-register. For physical
registers, it has no meaning.

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

13 years agoPass -disable-cfi to llc.
Rafael Espindola [Mon, 2 May 2011 19:51:34 +0000 (19:51 +0000)]
Pass -disable-cfi to llc.

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

13 years agollvmc: Pass -disable-cfi to llc.
Rafael Espindola [Mon, 2 May 2011 19:45:24 +0000 (19:45 +0000)]
llvmc: Pass -disable-cfi to llc.

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

13 years agoFix PR9579: when simplifying a compare to "true" or "false", and it was
Duncan Sands [Mon, 2 May 2011 18:51:41 +0000 (18:51 +0000)]
Fix PR9579: when simplifying a compare to "true" or "false", and it was
a vector compare, generate a vector result rather than i1 (and crashing).

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

13 years agoRemove unused variable.
Duncan Sands [Mon, 2 May 2011 18:41:29 +0000 (18:41 +0000)]
Remove unused variable.

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

13 years agoEmit debug info for global variables first.
Devang Patel [Mon, 2 May 2011 18:19:17 +0000 (18:19 +0000)]
Emit debug info for global variables first.
This works around a limitation in gdb which is reported by following inherit.exp test failures from gdb testsuite.

gdb.cp/inherit.exp: print g_vB.vB::vb
gdb.cp/inherit.exp: print g_vB.vB::vx
gdb.cp/inherit.exp: print g_vC.vC::vc
gdb.cp/inherit.exp: print g_vC.vC::vx
gdb.cp/inherit.exp: print g_vD.vB::vb
...

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

13 years agoForgot to commit the changes to this file.
Duncan Sands [Mon, 2 May 2011 16:34:19 +0000 (16:34 +0000)]
Forgot to commit the changes to this file.

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

13 years agoMove some rem transforms out of instcombine and into instsimplify.
Duncan Sands [Mon, 2 May 2011 16:27:02 +0000 (16:27 +0000)]
Move some rem transforms out of instcombine and into instsimplify.
This automagically provides a transform noticed by my super-optimizer
as occurring quite often: "rem x, (select cond, x, 1)" -> 0.

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

13 years agoAdd 130690 back.
Rafael Espindola [Mon, 2 May 2011 15:58:16 +0000 (15:58 +0000)]
Add 130690 back.

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

13 years agoOnly produce the eh_frame section if we have at least one personality function.
Rafael Espindola [Mon, 2 May 2011 15:49:52 +0000 (15:49 +0000)]
Only produce the eh_frame section if we have at least one personality function.

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

13 years agoRevert while I debug the tests that use march but not mtriple.
Rafael Espindola [Mon, 2 May 2011 15:42:31 +0000 (15:42 +0000)]
Revert while I debug the tests that use march but not mtriple.

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

13 years agoMove ppc OS X to cfi too. I am building it on an old ppc mini, but it will take some...
Rafael Espindola [Mon, 2 May 2011 15:00:52 +0000 (15:00 +0000)]
Move ppc OS X to cfi too. I am building it on an old ppc mini, but it will take some time.

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

13 years agoRemove an unused variable in NDEBUG (found with -Wunused-variable).
Chandler Carruth [Mon, 2 May 2011 05:49:01 +0000 (05:49 +0000)]
Remove an unused variable in NDEBUG (found with -Wunused-variable).

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

13 years agoMinimize the slot indexes spanned by register ranges created when splitting.
Jakob Stoklund Olesen [Mon, 2 May 2011 05:29:58 +0000 (05:29 +0000)]
Minimize the slot indexes spanned by register ranges created when splitting.

When an interfering live range ends at a dead slot index between two
instructions, make sure that the inserted copy instruction gets a slot index
after the dead ones. This makes it possible to avoid the interference.

Ideally, there shouldn't be interference ending at a deleted instruction, but
physical register coalescing can sometimes do that to sub-registers.

This fixes PR9823.

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

13 years agoAdd a SlotIndexes::insertMachineInstrInMaps to insert the instruction after any null...
Jakob Stoklund Olesen [Mon, 2 May 2011 05:29:56 +0000 (05:29 +0000)]
Add a SlotIndexes::insertMachineInstrInMaps to insert the instruction after any null indexes.

This makes a difference if a live interval is referring to a deleted
instruction. It can be important to insert an instruction before or after a
deleted instruction to avoid interference.

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

13 years agoIn option typo correction, consider -foo=VALUE flags as two distinct parts. The
Nick Lewycky [Mon, 2 May 2011 05:24:47 +0000 (05:24 +0000)]
In option typo correction, consider -foo=VALUE flags as two distinct parts. The
comments claimed it did this, but the LHS value was actually an unused variable.

The new system considers only the '-foo' part when comparing it for typos
against flags that have values, but still look at the whole string for flags
that don't. That way, we'll still correct '-inst=combine' to '-instcombine'.

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

13 years agoRemove dead variable pointed out by GCC 4.6 warnings, and reflow this a little
Nick Lewycky [Mon, 2 May 2011 05:05:29 +0000 (05:05 +0000)]
Remove dead variable pointed out by GCC 4.6 warnings, and reflow this a little
to scope a variable more tightly per llvm coding style. No functional change.

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

13 years agoenhance memcpyopt to obey -fno-builtin and friends. This addresses a
Chris Lattner [Sun, 1 May 2011 18:27:11 +0000 (18:27 +0000)]
enhance memcpyopt to obey -fno-builtin and friends.  This addresses a
problem reported on cfe-dev.

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

13 years agoAdd r130623 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.
Rafael Espindola [Sun, 1 May 2011 15:44:13 +0000 (15:44 +0000)]
Add r130623 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.

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

13 years agoWindows/DynamicLibrary.inc: Clean up ELM_Callback. We may check the decl instead...
NAKAMURA Takumi [Sun, 1 May 2011 13:29:49 +0000 (13:29 +0000)]
Windows/DynamicLibrary.inc: Clean up ELM_Callback. We may check the decl instead of the versions of individual libraries.

autoconf: Add checking ELM_Callback decl for mingw32 and mingw-w64.
cmake/config-ix.cmake: Add checking ELM_Callback decl for win32.

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

13 years agoRemove an unused variable from this function introduced in r130637,
Chandler Carruth [Sun, 1 May 2011 06:14:10 +0000 (06:14 +0000)]
Remove an unused variable from this function introduced in r130637,
likely a result of copy/paste.

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

13 years agoGCC uses a different encoding of pointers in the FDE when using
Rafael Espindola [Sun, 1 May 2011 04:49:54 +0000 (04:49 +0000)]
GCC uses a different encoding of pointers in the FDE when using
-fno-dwarf2-cfi-asm. Implement the same behavior.

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

13 years agoI forgot these files in the previous commit.
Rafael Espindola [Sun, 1 May 2011 04:19:24 +0000 (04:19 +0000)]
I forgot these files in the previous commit.

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

13 years agoSimplify the handling of pcrel relocations on ELF. Now we do the right thing
Rafael Espindola [Sun, 1 May 2011 03:50:49 +0000 (03:50 +0000)]
Simplify the handling of pcrel relocations on ELF. Now we do the right thing
for all symbol differences and can drop the old EmitPCRelSymbolValue
method.

This also make getExprForFDESymbol on ELF equal to the one on MachO, and it
can be made non-virtual.

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

13 years agoUpdate instructions: LLVM.cmake is now LLVMConfig.cmake
Oscar Fuentes [Sun, 1 May 2011 02:12:20 +0000 (02:12 +0000)]
Update instructions: LLVM.cmake is now LLVMConfig.cmake

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

13 years agoRevert the previous patch while I figure out how to make llvm-gcc
Rafael Espindola [Sat, 30 Apr 2011 23:03:44 +0000 (23:03 +0000)]
Revert the previous patch while I figure out how to make llvm-gcc
less agressive about disabling cfi on linux :-(

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

13 years agoX86AsmPrinter doesn't know how to handle the X86II::MO_GOT_ABSOLUTE_ADDRESS flag
Jakob Stoklund Olesen [Sat, 30 Apr 2011 23:00:05 +0000 (23:00 +0000)]
X86AsmPrinter doesn't know how to handle the X86II::MO_GOT_ABSOLUTE_ADDRESS flag
after folding ADD32ri to ADD32mi, so don't do that.

This only happens when the greedy register allocator gets itself in trouble and
spills %vreg9 here:

16L             %vreg9<def> = MOVPC32r 0, %ESP<imp-use>; GR32:%vreg9
48L             %vreg9<def> = ADD32ri %vreg9, <es:_GLOBAL_OFFSET_TABLE_>[TF=1], %EFLAGS<imp-def,dead>; GR32:%vreg9

That should never happen, the live range should be split instead.

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

13 years agoEnable CFI on OS X.
Rafael Espindola [Sat, 30 Apr 2011 22:29:54 +0000 (22:29 +0000)]
Enable CFI on OS X.
Currently the output should be almost identical to the one produced by CodeGen
to make the transition easier.

The only two differences I know of are:

* Some files get an extra advance loc of size 0. This will be fixed when
relaxations are enabled.
* The optimization of declaring an EH symbol as an external variable is not
implemented. This is a subset of adding the nounwind attribute, so we if really
this at -O0 we should probably do it at the IL level.

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

13 years agoWhen a physreg is live-in and live through a basic block, make sure its live
Jakob Stoklund Olesen [Sat, 30 Apr 2011 19:12:33 +0000 (19:12 +0000)]
When a physreg is live-in and live through a basic block, make sure its live
range covers the entire block.

The live range can't be terminated at a random instruction.

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

13 years agoInstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for urem or...
Benjamin Kramer [Sat, 30 Apr 2011 18:16:07 +0000 (18:16 +0000)]
InstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for urem or constant B.

This obviously helps a lot if the division would be turned into a libcall
(think i64 udiv on i386), but div is also one of the few remaining instructions
on modern CPUs that become more expensive when the bitwidth gets bigger.

This also helps register pressure on i386 when dividing chars, divb needs
two 8-bit parts of a 16 bit register as input where divl uses two registers.

int foo(unsigned char a) { return a/10; }
int bar(unsigned char a, unsigned char b) { return a/b; }

compiles into (x86_64)
_foo:
  imull $205, %edi, %eax
  shrl  $11, %eax
  ret
_bar:
  movzbl        %dil, %eax
  divb  %sil, %al
  movzbl        %al, %eax
  ret

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

13 years agoUse SimplifyDemandedBits on div instructions.
Benjamin Kramer [Sat, 30 Apr 2011 18:16:00 +0000 (18:16 +0000)]
Use SimplifyDemandedBits on div instructions.

This folds away silly stuff like (a&255)/1000 -> 0.

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

13 years agoFileCheckize.
Benjamin Kramer [Sat, 30 Apr 2011 18:15:53 +0000 (18:15 +0000)]
FileCheckize.

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

13 years agoImplement MCAsmStreamer::EmitEHSymAttributes. Doing this in the asm streamer
Rafael Espindola [Sat, 30 Apr 2011 16:34:57 +0000 (16:34 +0000)]
Implement MCAsmStreamer::EmitEHSymAttributes. Doing this in the asm streamer
is a bit ugly, but doing it on the base MCStreamer would be redundant
with the object streamer which does it using SD.

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

13 years agoHandle PrivateExtern eh symbols.
Rafael Espindola [Sat, 30 Apr 2011 16:22:46 +0000 (16:22 +0000)]
Handle PrivateExtern eh symbols.

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

13 years agoAllow folded spills in test.
Jakob Stoklund Olesen [Sat, 30 Apr 2011 08:00:50 +0000 (08:00 +0000)]
Allow folded spills in test.

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

13 years agoAvoid using stale entries form the sibling value map.
Jakob Stoklund Olesen [Sat, 30 Apr 2011 06:42:21 +0000 (06:42 +0000)]
Avoid using stale entries form the sibling value map.

This could happen when trying to use a value that had been eliminated after dead
code elimination and folding loads.

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

13 years agoUse hysteresis for local live range splitting as well.
Jakob Stoklund Olesen [Sat, 30 Apr 2011 05:07:46 +0000 (05:07 +0000)]
Use hysteresis for local live range splitting as well.

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

13 years agoruntime/libprofile/PathProfiling.c: Don't use // comment in C source.
NAKAMURA Takumi [Sat, 30 Apr 2011 03:53:56 +0000 (03:53 +0000)]
runtime/libprofile/PathProfiling.c: Don't use // comment in C source.

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

13 years agoAdd all the plumbing needed for MC to expand cfi to the old tables in
Rafael Espindola [Sat, 30 Apr 2011 03:44:37 +0000 (03:44 +0000)]
Add all the plumbing needed for MC to expand cfi to the old tables in
the final assembly. It is the same technique used when targeting
assemblers that don't support .loc.

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

13 years agoImplement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.
Rafael Espindola [Sat, 30 Apr 2011 03:21:04 +0000 (03:21 +0000)]
Implement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.

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

13 years agoUpdate comment.
Jakob Stoklund Olesen [Sat, 30 Apr 2011 03:13:08 +0000 (03:13 +0000)]
Update comment.

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

13 years agoUse a greedy algorithm for allocating registers.
Jakob Stoklund Olesen [Sat, 30 Apr 2011 01:37:54 +0000 (01:37 +0000)]
Use a greedy algorithm for allocating registers.

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

13 years agoWeekly fix of register allocation dependent unit tests.
Jakob Stoklund Olesen [Sat, 30 Apr 2011 01:37:52 +0000 (01:37 +0000)]
Weekly fix of register allocation dependent unit tests.

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

13 years agoPrint out the 'nontemporal' info on a store.
Bill Wendling [Fri, 29 Apr 2011 23:45:22 +0000 (23:45 +0000)]
Print out the 'nontemporal' info on a store.

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

13 years agoMake FastEmit_ri_ try a bit harder to succeed for supported operations; FastEmit_i...
Eli Friedman [Fri, 29 Apr 2011 23:34:52 +0000 (23:34 +0000)]
Make FastEmit_ri_ try a bit harder to succeed for supported operations; FastEmit_i can fail for non-Thumb2 ARM.  Makes ARMSimplifyAddress work correctly, and reduces the number of fast-isel bailouts on non-Thumb ARM.

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