Commit Graph

10602 Commits

Author SHA1 Message Date
Evan Cheng
f437f73348 Fix a potential bug that can cause miscomparison with and without debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 21:56:26 +00:00
Devang Patel
1905a18abc If FE forgot to provide a file name (usually it uses "stdin" as name in such situation) then make one up to ensure that debug info is not malformed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 20:57:49 +00:00
Jakob Stoklund Olesen
f6a129a24b Use the value mapping provided by LiveIntervalMap. This simplifies the code a
great deal because we don't have to worry about maintaining SSA form.

Unconditionally copy back to dupli when the register is live out of the split
range, even if the live-out value was defined outside the range. Skipping the
back-copy only makes sense when the live range is going to spill outside the
split range, and we don't know that it will. Besides, this was a hack to avoid
SSA update issues.

Clear up some confusion about the end point of a half-open LiveRange. Methinks
LiveRanges need to be closed so both start and end are included in the range.
The low bits of a SlotIndex are symbolic, so a half-open range doesn't really
make sense. This would be a pervasive change, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 00:01:36 +00:00
Devang Patel
27ede1ba6d Check bb to ensure that alloca is in separate basic block.
This fixes funcargs.exp regression reported by gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 18:13:55 +00:00
Devang Patel
1397fdc0ab If dbg.declare from non-entry block is using alloca from entry block then use offset available in StaticAllocaMap to emit DBG_VALUE. Right now, this has no material impact because varible info also collected using offset table maintained in machine module info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 14:48:53 +00:00
Gabor Greif
4f7d107d1d must not peephole away side effects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 20:46:08 +00:00
Devang Patel
6fe75aaaeb Use frame index, if available for byval argument while lowering dbg_declare. Otherwise let getRegForValue() find register for this argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 20:29:31 +00:00
Michael J. Spencer
3a210e2d30 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:59:48 +00:00
Jakob Stoklund Olesen
dd9f3fdc77 Mechanically replace LiveInterval* with LiveIntervalMap for intervals being
edited without actually using LiveIntervalMap functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:29:11 +00:00
Jakob Stoklund Olesen
9ca2aeb2d2 Allow LiveIntervalMap to be reused by resetting the current live interval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:29:09 +00:00
Jakob Stoklund Olesen
b3e9681cc0 Let's just declare that it is impossible to construct a std::pair from a null
pointer and work around that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 21:29:45 +00:00
Benjamin Kramer
12ea765632 Fix linux/msvc build, move include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 20:04:49 +00:00
Eric Christopher
1a56e083e7 Silence more warnings. Two more unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:30:57 +00:00
John Thompson
eac6e1d0c7 Added skeleton for inline asm multiple alternative constraint support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:15:37 +00:00
Bill Wendling
a65568676d Rename ConvertToSetZeroFlag to something more general.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 00:13:50 +00:00
Bill Wendling
3665661a57 No need to recompute the SrcReg and CmpValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 23:46:12 +00:00
Bill Wendling
92ad57f066 Move some of the decision logic for converting an instruction into one that sets
the 'zero' bit down into the back-end. There are other cases where this logic
isn't sufficient, so they should be handled separately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 23:34:19 +00:00
Bob Wilson
59718a4f42 Fix a comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 22:42:21 +00:00
Bill Wendling
220e240bdf Modify the comparison optimizations in the peephole optimizer to update the
iterator when an optimization took place. This allows us to do more insane
things with the code than just remove an instruction or two.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:55:43 +00:00
Michael J. Spencer
4e9c939312 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:14:25 +00:00
Devang Patel
4bafda9618 Add DEBUG message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 20:32:09 +00:00
Evan Cheng
3ef1c8759a Teach if-converter to be more careful with predicating instructions that would
take multiple cycles to decode.
For the current if-converter clients (actually only ARM), the instructions that
are predicated on false are not nops. They would still take machine cycles to
decode. Micro-coded instructions such as LDM / STM can potentially take multiple
cycles to decode. If-converter should take treat them as non-micro-coded
simple instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 01:29:16 +00:00
Jakob Stoklund Olesen
4a4bc3fba6 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 18:50:24 +00:00
Jakob Stoklund Olesen
6b964cd211 Don't add <imp-def> operands during register rewriting.
LiveIntervals already adds <imp-def> operands for super-registers when a subreg
def defines the whole register. Thus, it is not necessary to do it again when
rewriting.

In fact, the super-register imp-defs caused miscompilations because the late
scheduler couldn't see that the super-register was read.

We still add super-reg <imp-use,kill> operands when rewriting virtuals to
physicals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 22:38:45 +00:00
Chris Lattner
dfe254b86e add a comment about where this should eventually move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:33:40 +00:00
Lang Hames
b76d20969f Added initialisers for reduction rule counters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 13:42:32 +00:00
Chris Lattner
beac75da37 implement rdar://6653118 - fastisel should fold loads where possible.
Since mem2reg isn't run at -O0, we get a ton of reloads from the stack,
for example, before, this code:

int foo(int x, int y, int z) {
  return x+y+z;
}

used to compile into:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	movl	4(%rsp), %esi
	addl	%edx, %esi
	movl	(%rsp), %edx
	addl	%esi, %edx
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Now we produce:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	addl	4(%rsp), %edx    ## Folded load
	addl	(%rsp), %edx     ## Folded load
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Fewer instructions and less register use = faster compiles.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 02:18:34 +00:00
Jakob Stoklund Olesen
07c2b7ff68 Remove dead code.
Clobber ranges are no longer used when joining physical registers.
Instead, all aliases are checked for interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 21:09:33 +00:00
Chris Lattner
17aa68055b zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:12:00 +00:00
Jim Grosbach
ee72651df4 previous patch was a little too tricky for its own good. Don't try to
overload UserInInstr. Explicitly check Allocatable. The early exit in the
condition will mean the performance impact of the extra test should be
minimal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 21:45:15 +00:00
Bob Wilson
ef134d02e0 Add a missing check when legalizing a vector extending load. This doesn't
solve the root problem, but it corrects the bug in the code I added to
support legalizing in the case where the non-extended type is also legal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:20:37 +00:00
Jakob Stoklund Olesen
1e3aeefc08 VirtRegRewriter checks for early clobbers before it reuses an available stack
slot.

Teach it to also check for early clobbered aliases, and early clobber operands
following the current operand.

This fixes the miscompilation in PR8044 where EC registers eax and ecx were
being used for inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 18:36:56 +00:00
Duncan Sands
850fcd4705 Reapply commit 112702 which was speculatively reverted by echristo.
Original commit message:
Use the SSAUpdator to turn calls to eh.exception that are not in a
landing pad into uses of registers rather than loads from a stack
slot.  Doesn't touch the 'orrible hack code - Bill needs to persuade
me harder :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 08:31:48 +00:00
Devang Patel
a660be7587 There is no need to use .set here.
Thanks Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:01:10 +00:00
Devang Patel
3f74a116c8 Detect undef value early and save unnecessary NodeMap query.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:29:42 +00:00
Dan Gohman
24bde5bce1 Don't narrow the load and store in a load+twiddle+store sequence unless
there are clearly no stores between the load and the store. This fixes
this miscompile reported as PR7833.

This breaks the test/CodeGen/X86/narrow_op-2.ll optimization, which is
safe, but awkward to prove safe. Move it to X86's README.txt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:18:42 +00:00
Devang Patel
8e741ed2fa Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:02:27 +00:00
Jim Grosbach
9204ddad5c The scavenger should just use getAllocatableSet() rather than reinventing it
locally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:29:04 +00:00
Jim Grosbach
9b041c92ef Anti-dependency breaking needs to be careful not to use reserved regs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 17:12:55 +00:00
Devang Patel
b1fcfbe89b Fix .debug_range for linux. Patch by Krister Wombell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 16:43:44 +00:00
Lang Hames
33198391d6 Added support for register allocators to record which intervals are spill intervals, and where the uses and defs of the original intervals were in the original code.
Spill intervals can be hidden using the "-rmf-intervals=virt-nospills*" option.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 08:27:00 +00:00
Chandler Carruth
4315093eb7 Silence an ambiguous else warning from GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 07:08:05 +00:00
Lang Hames
7642572e6d Added counters for PBQP reduction rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 05:37:52 +00:00
Jim Grosbach
d273a003b6 Add a bit of debug output for register scavenging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 00:51:37 +00:00
Jim Grosbach
188da252ab Tweak to ignoring reserved regs. The allocator was occasionally still looking
at them since they'd end up in the register weights list. Tell it to stop
doing that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:48:34 +00:00
Jakob Stoklund Olesen
0077114efc Teach RemoveCopyByCommutingDef to check all aliases, not just subregisters.
This caused a miscompilation in WebKit where %RAX had conflicting defs when
RemoveCopyByCommutingDef was commuting a %EAX use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:15:35 +00:00
Jim Grosbach
662fb77687 tidy up trailing whitespace and an 80 column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:48:06 +00:00
Jim Grosbach
5a4cbea312 cleanup per feedback. use a helper function for getting the first non-reserved
physical register in a register class. Make sure to assert if the register
class is empty.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:34:41 +00:00
Jim Grosbach
269354e570 The register allocator shouldn't consider allocating reserved registers. PBQP version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:23:03 +00:00
Jim Grosbach
067a648599 The register allocator shouldn't consider allocating reserved registers.
r112728 did this for fast regalloc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:04:27 +00:00