Commit Graph

44399 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 29836e6572 Include a shadow of the original CFG edges in the edge bundle graph.
llvm-svn: 122444
2010-12-22 22:01:28 +00:00
Rafael Espindola a6cd2d821a Rename NeedsSetToChangeDiffSize to HasAggressiveSymbolFolding which is a much
better name and matches what is used in the MachO writer.

llvm-svn: 122443
2010-12-22 21:51:29 +00:00
Daniel Dunbar ac8173cf71 MC/Mach-O/ARM: Don't try to use scattered relocs for BR24 fixups.
llvm-svn: 122441
2010-12-22 21:26:43 +00:00
Rafael Espindola 0e14b61c0b Revert r122359 while I debug PR8845.
llvm-svn: 122427
2010-12-22 19:05:49 +00:00
Matt Beaumont-Gay 6b5d2519b3 Fix another conditional expression mismatched enum type warning.
llvm-svn: 122419
2010-12-22 18:25:55 +00:00
Duncan Sands a45cfbd405 When determining whether the new instruction was already present in
the original instruction, half the cases were missed (making it not
wrong but suboptimal).  Also correct a typo (A <-> B) in the second
chunk. 

llvm-svn: 122414
2010-12-22 17:15:25 +00:00
Daniel Dunbar 45140d2efc MC/Mach-O/ARM: We always use the SECTDIFF reloc type on ARM, which is
esp. important given that the LOCAL_SECTDIFF enumeration got redefined.

llvm-svn: 122412
2010-12-22 16:52:19 +00:00
Daniel Dunbar 11617c8666 MC/Mach-O/ARM: Clone off an ARM version of RecordScatteredRelocation until I figure out how it is supposed to work.
llvm-svn: 122410
2010-12-22 16:45:29 +00:00
Daniel Dunbar dde72ef0c1 MC/Mach-O: Return to reporting errors if we see unexpected fixup kinds.
llvm-svn: 122409
2010-12-22 16:32:41 +00:00
Daniel Dunbar a191cfd97e MC/Mach-O/ARM: Recognize generic _Data_N fixup kinds.
llvm-svn: 122408
2010-12-22 16:32:37 +00:00
Daniel Dunbar 9ccf843a61 MC/Mach-O/ARM: Add enough relocation logic to get BR24 relocations.
llvm-svn: 122407
2010-12-22 16:19:24 +00:00
Daniel Dunbar 56f13732e2 MC/Mach-O/ARM: Fix thinko.
llvm-svn: 122406
2010-12-22 16:19:20 +00:00
Rafael Espindola 50ce2f06de Use references and simplify.
llvm-svn: 122405
2010-12-22 16:11:57 +00:00
Rafael Espindola 73c0ae77ca Simplify the handling of .size expressions.
llvm-svn: 122404
2010-12-22 16:03:00 +00:00
Daniel Dunbar 083132e131 MC/Mach-O/ARM: Stub out RecordARMRelocation, which is mostly a copy of
RecordRelocation with lots of FIXMEs.

llvm-svn: 122402
2010-12-22 13:50:05 +00:00
Daniel Dunbar a63db77f2e Simplify.
llvm-svn: 122401
2010-12-22 13:49:56 +00:00
Daniel Dunbar 1e5be3653c MC/Mach-O: Split out RecordARMRelocation for now, it is weird enough it isn't
clear how to keep in the generic path (yet).
 - Will revisit when it actually works.

llvm-svn: 122400
2010-12-22 13:49:43 +00:00
Duncan Sands fbb9ac3cca Add a generic expansion transform: A op (B op' C) -> (A op B) op' (A op C)
if both A op B and A op C simplify.  This fires fairly often but doesn't
make that much difference.  On gcc-as-one-file it removes two "and"s and
turns one branch into a select.

llvm-svn: 122399
2010-12-22 13:36:08 +00:00
Che-Liang Chiou aaedf8be1c ptx: add ld instruction and test
llvm-svn: 122398
2010-12-22 10:38:51 +00:00
Duncan Sands 3547d2ebd8 Add some statistics, good for understanding how much more powerful
instcombine is compared to instsimplify.

llvm-svn: 122397
2010-12-22 09:40:51 +00:00
Chris Lattner cafc1e60bb Fix a bug in ReduceLoadWidth that wasn't handling extending
loads properly.  We miscompiled the testcase into:

_test:                                  ## @test
	movl	$128, (%rdi)
	movzbl	1(%rdi), %eax
	ret

Now we get a proper:

_test:                                  ## @test
	movl	$128, (%rdi)
	movsbl	(%rdi), %eax
	movzbl	%ah, %eax
	ret

This fixes PR8757.

llvm-svn: 122392
2010-12-22 08:02:57 +00:00
Chris Lattner 9a499e96eb more cleanups, move a check for "roundedness" earlier to reject
unhanded cases faster and simplify code.

llvm-svn: 122391
2010-12-22 08:01:44 +00:00
Chris Lattner 222374d886 reduce indentation and improve comments, no functionality change.
llvm-svn: 122389
2010-12-22 07:36:50 +00:00
Wesley Peck ff2cd2ea6c Don't generate carry bit when loading immediate values on the Microblaze.
llvm-svn: 122385
2010-12-22 01:29:32 +00:00
Wesley Peck 3a3a5795c5 Add support for some of the LLVM atomic operations to the MBlaze backend.
llvm-svn: 122384
2010-12-22 01:15:01 +00:00
Wesley Peck 1cd1554ca0 Modeling the carry bit in the MSR register of the MicroBlaze.
llvm-svn: 122381
2010-12-22 00:53:07 +00:00
Wesley Peck 8143c61b91 Fix a regression introduced into the MBlaze delay slot filler.
llvm-svn: 122379
2010-12-22 00:22:59 +00:00
Owen Anderson 5ab8d4b5e5 Give GVN back the ability to perform simple conditional propagation on conditional branch values.
I still think that LVI should be handling this, but that capability is some ways off in the future,
and this matters for some significant benchmarks.

llvm-svn: 122378
2010-12-21 23:54:34 +00:00
Matt Beaumont-Gay 890cb2d506 GCC objects to the two sides of a conditional expression having different enum
types, but they're just getting converted to unsigned anyway, so cast first
(and ask questions later).

llvm-svn: 122377
2010-12-21 23:43:23 +00:00
Owen Anderson 12470778d7 Remove dead code.
llvm-svn: 122371
2010-12-21 22:31:24 +00:00
Andrew Trick fbb3ed8774 In DelayForLiveRegsBottomUp, handle instructions that read and write
the same physical register. Simplifies the fix from the previous
checkin r122211.

llvm-svn: 122370
2010-12-21 22:27:44 +00:00
Andrew Trick 2085a96513 whitespace
llvm-svn: 122368
2010-12-21 22:25:04 +00:00
Dale Johannesen a94e36bbee Reapply 122353-122355 with fixes. 122354 was wrong;
the shift type was needed one place, the shift count
type another.  The transform in 123555 had the same
problem.

llvm-svn: 122366
2010-12-21 21:55:50 +00:00
Benjamin Kramer f6ddc4a1de Add some x86 specific dagcombines for conditional increments.
(add Y, (sete  X, 0)) -> cmp X, 1; adc  0, Y
(add Y, (setne X, 0)) -> cmp X, 1; sbb -1, Y
(sub (sete  X, 0), Y) -> cmp X, 1; sbb  0, Y
(sub (setne X, 0), Y) -> cmp X, 1; adc -1, Y

for
  unsigned foo(unsigned a, unsigned b) {
    if (a == 0) b++;
    return b;
  }
we now get:
  foo:
    cmpl  $1, %edi
    movl  %esi, %eax
    adcl  $0, %eax
    ret
instead of:
  foo:
    testl %edi, %edi
    sete  %al
    movzbl  %al, %eax
    addl  %esi, %eax
    ret

llvm-svn: 122364
2010-12-21 21:41:44 +00:00
Benjamin Kramer 43493c089f GVN's Expression is not POD-like (it contains a SmallVector). Simplify code while at it.
llvm-svn: 122362
2010-12-21 21:30:19 +00:00
Dale Johannesen 87c47499c6 Revert 122353-122355 for the moment, they broke stuff.
llvm-svn: 122360
2010-12-21 21:22:27 +00:00
Rafael Espindola a468ae02cb Simplify EvaluateAsAbsolute now that EvaluateAsRelocatableImpl does all
the folding it can.

llvm-svn: 122359
2010-12-21 20:51:42 +00:00
Rafael Espindola 6bdb49ded8 Don't relax org or align. They change size as the relaxation happens, but they
are not actually relaxed. For example, a section with only alignments will never
needs relaxation.

llvm-svn: 122356
2010-12-21 20:35:18 +00:00
Dale Johannesen caf42aa6a4 Add a new transform to DAGCombiner.
llvm-svn: 122355
2010-12-21 20:10:51 +00:00
Dale Johannesen fa5dc82fda Get the type of a shift from the shift, not from its shift
count operand.  These should be the same but apparently are
not always, and this is cleaner anyway.  This improves the
code in an existing test.

llvm-svn: 122354
2010-12-21 20:06:19 +00:00
Dale Johannesen d64931df77 Shift by the word size is invalid IR; don't create it.
llvm-svn: 122353
2010-12-21 20:00:06 +00:00
Chris Lattner 2a7ff99979 fix some typos
llvm-svn: 122349
2010-12-21 18:05:22 +00:00
Stuart Hastings 83cce8e7ab Fix indentation, add comment.
llvm-svn: 122345
2010-12-21 17:16:58 +00:00
Duncan Sands 3b8af41a3e Visit instructions deterministically. Use a FIFO so as to approximately
visit instructions before their uses, since InstructionSimplify does a
better job in that case.  All this prompted by Frits van Bommel.

llvm-svn: 122343
2010-12-21 17:08:55 +00:00
Stuart Hastings 8c5bfcaa29 Missing logic for nested CALLSEQ_START/END.
llvm-svn: 122342
2010-12-21 17:07:24 +00:00
Duncan Sands e7cbb64ec0 If an instruction simplifies, try again to simplify any uses of it. This is
not very important since the pass is only used for testing, but it does make
it more realistic.  Suggested by Frits van Bommel.

llvm-svn: 122336
2010-12-21 16:12:03 +00:00
Daniel Dunbar ff78eda678 MC/Mach-O: Shuffle enums a bit to make it harder to inadvertently use the wrong
type.

llvm-svn: 122334
2010-12-21 15:26:45 +00:00
Duncan Sands fecc642224 While I don't think any later transforms can fire, it seems cleaner to
not assume this (for example in case more transforms get added below
it).  Suggested by Frits van Bommel.

llvm-svn: 122332
2010-12-21 15:03:43 +00:00
Duncan Sands 5def0d6791 Fix inverted condition noticed by Frits van Bommel.
llvm-svn: 122331
2010-12-21 14:48:48 +00:00
Duncan Sands d0eb6d39f8 Pull a few more simplifications out of instcombine (there are still
plenty left though!), in particular for multiplication.

llvm-svn: 122330
2010-12-21 14:00:22 +00:00