Commit Graph

46682 Commits

Author SHA1 Message Date
Devang Patel b5ea255fb4 Fix an off by one error while accessing complex address element of a DIVariable.
This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together)

llvm-svn: 130225
2011-04-26 18:24:39 +00:00
Chris Lattner eb045f9c02 Improve the bail-out predicate to really only kick in when phi
translation fails.  We were bailing out in some cases that would
cause us to miss GVN'ing some non-local cases away.

llvm-svn: 130206
2011-04-26 17:41:02 +00:00
Dan Gohman 7da91aee83 Fast-isel support for simple inline asms.
llvm-svn: 130205
2011-04-26 17:18:34 +00:00
Duncan Sands d4ea3ec87f Another example of a static table that wasn't marked static.
llvm-svn: 130193
2011-04-26 07:30:10 +00:00
Chris Lattner 189ca1498f don't emit the symbol name twice for local bss and common
symbols.  For example, don't emit:
        .comm   _i,4,2                  ## @i
                                        ## @i

instead emit:
        .comm   _i,4,2                  ## @i

llvm-svn: 130192
2011-04-26 06:14:13 +00:00
Evan Cheng 2f64754031 Fix typo
llvm-svn: 130190
2011-04-26 04:57:37 +00:00
Rafael Espindola 80cb3cb1d6 Print all the moves at a given label instead of just the first one.
Remove previous DwarfCFI hack.

llvm-svn: 130187
2011-04-26 03:58:56 +00:00
Nick Lewycky c58d293a6f Rename everything to follow LLVM style ... I think.
Add support for switch and indirectbr edges. This works by densely numbering
all blocks which have such terminators, and then separately numbering the
possible successors. The predecessors write down a number, the successor knows
its own number (as a ConstantInt) and sends that and the pointer to the number
the predecessor wrote down to the runtime, who looks up the counter in a
per-function table.

Coverage data should now be functional, but I haven't tested it on anything
other than my 2-file synthetic test program for coverage.

llvm-svn: 130186
2011-04-26 03:54:16 +00:00
Rafael Espindola 3584ab6cc6 No relocation produces a SLEB or ULEB, make sure they are handled in MC.
llvm-svn: 130181
2011-04-26 02:17:58 +00:00
Chris Lattner 6f83d06ffa Enhance MemDep: When alias analysis returns a partial alias result,
return it as a clobber.  This allows GVN to do smart things.

Enhance GVN to be smart about the case when a small load is clobbered
by a larger overlapping load.  In this case, forward the value.  This
allows us to compile stuff like this:

int test(void *P) {
  int tmp = *(unsigned int*)P;
  return tmp+*((unsigned char*)P+1);
}

into:

_test:                                  ## @test
	movl	(%rdi), %ecx
	movzbl	%ch, %eax
	addl	%ecx, %eax
	ret

which has one load.  We already handled the case where the smaller
load was from a must-aliased base pointer.

llvm-svn: 130180
2011-04-26 01:21:15 +00:00
Devang Patel cae2fbd6fc Let dwarf writer allocate extra space in the debug location expression. This space, if requested, will be used for complex addresses of the Blocks' variables.
llvm-svn: 130178
2011-04-26 00:12:46 +00:00
Devang Patel 2606f4d6d2 Rename a local variable.
llvm-svn: 130171
2011-04-25 23:05:21 +00:00
Devang Patel 8ce24133fd Rename a method to match what it really does.
s/addVariableAddress/addFrameVariableAddress/g

llvm-svn: 130170
2011-04-25 23:02:17 +00:00
Devang Patel 2688e4aba6 Do not drop a variable's complex address if it is not based on frame base.
Observed this while reading code, so I do not have a test case handy here.

llvm-svn: 130167
2011-04-25 22:52:55 +00:00
Dan Gohman 6acd95b3c1 Fix an iterator invalidation bug.
llvm-svn: 130166
2011-04-25 22:48:29 +00:00
Chris Lattner f5ba0415df mark a large static table static. Pointed out by Michael Ilseman!
llvm-svn: 130160
2011-04-25 22:14:33 +00:00
Chris Lattner 63e9190f71 allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
patch by Johannes Schaub!

llvm-svn: 130151
2011-04-25 20:58:50 +00:00
Chris Lattner 6e29892430 add a missed bitfield instcombine.
llvm-svn: 130137
2011-04-25 18:44:26 +00:00
Akira Hatanaka 0e7ee666b7 Lower BlockAddress node when relocation-model is static.
llvm-svn: 130131
2011-04-25 17:10:45 +00:00
Devang Patel 734f2218ac A dbg.declare may not be in entry block, even if it is referring to an incoming argument. However, It is appropriate to emit DBG_VALUE referring to this incoming argument in entry block in MachineFunction.
llvm-svn: 130129
2011-04-25 16:33:52 +00:00
Chandler Carruth 9b73c8e293 Remove some hard coded CR-LFs. Some of these were the entire files, one of
these was just one line of a file. Explicitly set the eol-style property on the
files to try and ensure this fix stays.

llvm-svn: 130125
2011-04-25 07:11:23 +00:00
Duncan Sands 56ca6292dc Fix comment typo. Noticed by Liu.
llvm-svn: 130120
2011-04-25 06:21:43 +00:00
Rafael Espindola a076199e71 Simplify the logic. Noticed by aKor.
llvm-svn: 130116
2011-04-24 19:55:34 +00:00
Rafael Espindola 5c54ecc9af Synchronize the conditions for producing a .cfi_startproc and a .cfi_endproc.
Fixes PR9787.

llvm-svn: 130115
2011-04-24 19:00:34 +00:00
Sebastian Redl 5519ff9d4e Fix Target/ARM/Thumb1FrameLowering.h header guard.
llvm-svn: 130097
2011-04-24 15:47:01 +00:00
Sebastian Redl 1b86ea80bb Give MC/MCDisassembler/Disassembler.h a header guard.
llvm-svn: 130096
2011-04-24 15:46:56 +00:00
Sebastian Redl b8a62aa3c9 Give SplitKit.h a header guard.
llvm-svn: 130095
2011-04-24 15:46:51 +00:00
Jay Foad f7adb3204e Fix an assert to check exactly what it says.
llvm-svn: 130093
2011-04-24 14:30:00 +00:00
Jay Foad dbf81d8ddf PR9214: Convert the DIBuilder API to use ArrayRef.
llvm-svn: 130086
2011-04-24 10:11:03 +00:00
Jay Foad 1a180156b6 Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Jay Foad 72e705ed94 Like the coding standards say, do not use "using namespace std".
llvm-svn: 130054
2011-04-23 09:06:00 +00:00
Benjamin Kramer 3db054650b Silence an overzealous uninitialized variable warning from GCC.
llvm-svn: 130053
2011-04-23 08:21:06 +00:00
Andrew Trick 0ed5778a1e Thumb2 and ARM add/subtract with carry fixes.
Fixes Thumb2 ADCS and SBCS lowering: <rdar://problem/9275821>.
t2ADCS/t2SBCS are now pseudo instructions, consistent with ARM, so the
assembly printer correctly prints the 's' suffix.

Fixes Thumb2 adde -> SBC matching to check for live/dead carry flags.

Fixes the internal ARM machine opcode mnemonic for ADCS/SBCS.
Fixes ARM SBC lowering to check for live carry (potential bug).

llvm-svn: 130048
2011-04-23 03:55:32 +00:00
Andrew Trick 1a1f8d4640 whitespace
llvm-svn: 130046
2011-04-23 03:24:11 +00:00
Owen Anderson dd450b86cf Teach FastISel to deal with instructions that have two immediate operands.
llvm-svn: 130033
2011-04-22 23:38:06 +00:00
Devang Patel 1d6bbd41aa Let front-end tie subprogram declaration with subprogram definition directly.
llvm-svn: 130028
2011-04-22 23:10:17 +00:00
Jakob Stoklund Olesen 032891b718 Always compare the cost of region splitting with the cost of per-block splitting.
Sometimes it is better to split per block, and we missed those cases.

llvm-svn: 130025
2011-04-22 22:47:40 +00:00
Chris Lattner 6d277517d1 Recommit the fix for rdar://9289512 with a couple tweaks to
fix bugs exposed by the gcc dejagnu testsuite:
1. The load may actually be used by a dead instruction, which
   would cause an assert.
2. The load may not be used by the current chain of instructions,
   and we could move it past a side-effecting instruction. Change
   how we process uses to define the problem away.

llvm-svn: 130018
2011-04-22 21:59:37 +00:00
Johnny Chen 57c892860e Disassembly of A8.6.59 LDR (literal) Encoding T1 (16-bit thumb instruction) should
print out ldr, not ldr.n.

rdar://problem/9267772

llvm-svn: 130008
2011-04-22 19:12:43 +00:00
Benjamin Kramer 341c11da3b DAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.
On x86 this allows to fold a load into the cmp, greatly reducing register pressure.
  movzbl	(%rdi), %eax
  cmpl	$47, %eax
->
  cmpb	$47, (%rdi)

This shaves 8k off gcc.o on i386. I'll leave applying the patch in README.txt to Chris :)

llvm-svn: 130005
2011-04-22 18:47:44 +00:00
Devang Patel ad45d911bb Do not leak argument's DbgVariables.
llvm-svn: 130004
2011-04-22 18:09:57 +00:00
Devang Patel 3c39ec2933 Add asserts.
llvm-svn: 129995
2011-04-22 16:44:29 +00:00
Benjamin Kramer 4c81624735 X86: Try to use a smaller encoding by transforming (X << C1) & C2 into (X & (C2 >> C1)) & C1. (Part of PR5039)
This tends to happen a lot with bitfield code generated by clang. A simple example for x86_64 is
uint64_t foo(uint64_t x) { return (x&1) << 42; }
which used to compile into bloated code:
	shlq	$42, %rdi               ## encoding: [0x48,0xc1,0xe7,0x2a]
	movabsq	$4398046511104, %rax    ## encoding: [0x48,0xb8,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00]
	andq	%rdi, %rax              ## encoding: [0x48,0x21,0xf8]
	ret                             ## encoding: [0xc3]

with this patch we can fold the immediate into the and:
	andq	$1, %rdi                ## encoding: [0x48,0x83,0xe7,0x01]
	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
	shlq	$42, %rax               ## encoding: [0x48,0xc1,0xe0,0x2a]
	ret                             ## encoding: [0xc3]

It's possible to save another byte by using 'andl' instead of 'andq' but I currently see no way of doing
that without making this code even more complicated. See the TODOs in the code.

llvm-svn: 129990
2011-04-22 15:30:40 +00:00
Eric Christopher ae95ad1935 Use enums for constant values.
llvm-svn: 129984
2011-04-22 06:34:01 +00:00
Eric Christopher 22a19816f6 Make the file format strings a little prettier for mach-o.
llvm-svn: 129980
2011-04-22 04:08:58 +00:00
Eric Christopher 1dd335de65 Add MachOObjectFile.cpp to cmake.
llvm-svn: 129978
2011-04-22 04:06:24 +00:00
Eric Christopher bafb9347dd Hook in mach-o object files into Object interface.
llvm-svn: 129976
2011-04-22 03:50:50 +00:00
Eric Christopher 3509d2dc95 Add support for 64-bit object files to Path.
llvm-svn: 129975
2011-04-22 03:50:19 +00:00
Eric Christopher 7b015c7598 Add an ObjectFile implementation for mach-o.
Patch by Patrick Walton!

llvm-svn: 129974
2011-04-22 03:19:48 +00:00
Eric Christopher 5c896f71ec 80-col fix.
llvm-svn: 129973
2011-04-22 03:07:06 +00:00