Commit Graph

9692 Commits

Author SHA1 Message Date
Devang Patel
6122a4d1c0 Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 15:37:09 +00:00
Benjamin Kramer
1bd7335a17 Use twines to simplify calls to report_fatal_error. For code size and readability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 10:44:28 +00:00
Evan Cheng
c3b0c341e7 Avoid using f64 to lower memcpy from constant string. It's cheaper to use i32 store of immediates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 07:37:57 +00:00
Evan Cheng
4038f9c21b Make post regalloc machine licm functional. It now passes all of MultiSource.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 01:03:47 +00:00
Chris Lattner
6129c37693 convert a report_fatal_error that I was able to trigger into a nice error
so the user at least knows what inline asm is a problem.  For example:

error: inline asm not supported yet: don't know how to handle tied indirect register inputs
pr8788-1.c:14:10: note: generated from here
    asm ("\n" : "+r" (stack->regs)
         ^

Instead of:
fatal error: error in backend: Don't know how to handle tied indirect register inputs yet!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 00:09:16 +00:00
Chris Lattner
87d677c185 minor tidying.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 23:50:38 +00:00
Chris Lattner
35a389344d use assertions instead of unreachable for logic errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 23:47:51 +00:00
Chris Lattner
38686bdffd introduce a new recoverable error handling API to LLVMContext
and use it in one place in inline asm handling stuff.  Before
we'd generate this for an invalid modifier letter:

$ clang asm.c -c -o t.o
fatal error: error in backend: Invalid operand found in inline asm: 'abc incl    ${0:Z}'
INLINEASM <es:abc incl    ${0:Z}>, 10, %EAX<def>, 2147483657, %EAX, 14, %EFLAGS<earlyclobber,def,dead>, <!-1>


Now we generate this:

$ clang asm.c -c -o t.o
error: invalid operand in inline asm: 'incl    ${0:Z}'
asm.c:3:12: note: generated from here
  __asm__ ("incl    %Z0" : "+r" (X));
           ^
1 error generated.

This is much better but still admittedly not great ("why" is the operand 
invalid??), codegen should try harder with its diagnostics :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 23:40:44 +00:00
Chris Lattner
75361b69f3 rename llvm::llvm_report_error -> llvm::report_fatal_error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:58:41 +00:00
Chris Lattner
1ca6531e2e remove some unneeded errorhandling stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:44:07 +00:00
Chris Lattner
00d139064e tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:29:10 +00:00
Anton Korobeynikov
4b38debf59 Remove late ARM codegen optimization pass committed by accident.
It is not ready for public yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:23:27 +00:00
Anton Korobeynikov
96085a36db Initial support for different kinds of FU reservation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:19:32 +00:00
Anton Korobeynikov
1298948c5c Factor out scoreboard into separate class. This way we might have several different score boards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100644 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:19:24 +00:00
Anton Korobeynikov
977dfcefa1 Add hook to insert late LLVM=>LLVM passes just before isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:18:42 +00:00
Chris Lattner
7f893c0712 fix 80 col violation, patch by Alastair Lynn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:13:33 +00:00
Chris Lattner
c0561f29a8 add a comment line that got dropped
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:10:38 +00:00
Chris Lattner
24ad3ed71f fix a latent bug my inline asm stuff exposed:
MachineOperand::isIdenticalTo wasn't handling metadata operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:03:19 +00:00
Benjamin Kramer
96fbb3eea6 Remove unused method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 11:23:46 +00:00
Torok Edwin
9c4210794e Workaround the breakage in r100616 by guarding all timers with
TimePassesIsEnabled. This should allow make check to pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 10:44:46 +00:00
Bill Wendling
5f017e8086 Use the "NamedGroupTimer" class to categorize DWARF emission better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 09:28:04 +00:00
Benjamin Kramer
a592e671ee Use raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100615 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 09:26:51 +00:00
Evan Cheng
5b463905be Add comments for missed opportunities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100610 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 06:00:33 +00:00
Evan Cheng
348856e56a Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 05:59:12 +00:00
Chris Lattner
cf9a415182 Have the inst emitter add the !srcloc mdnode to the machine instr.
Have the asmprinter use the mdnode to scavenge a source location if
present.  Document this nonsense in langref.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100607 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 05:38:05 +00:00
Chris Lattner
fee455ea6a remove another magic number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100606 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 05:27:36 +00:00
Chris Lattner
decc267151 Three changes:
1. Introduce some enums and accessors in the InlineAsm class
   that eliminate a ton of magic numbers when handling inline
   asm SDNode.
2. Add a new MDNodeSDNode selection dag node type that holds
   a MDNode (shocking!)
3. Add a new argument to ISD::INLINEASM nodes that hold !srcloc
   metadata, propagating it to the instruction emitter, which
   drops it.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100605 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 05:20:54 +00:00
Dale Johannesen
343b42e428 Move printing of target-indepedent DEBUG_VALUE comments
into AsmPrinter.  Target-dependent form is still generated
by FastISel and still handled in X86 code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 01:15:14 +00:00
Evan Cheng
d94671a25e Post regalloc LICM. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 00:41:17 +00:00
Devang Patel
5f0940002a Do not emit specification DIE with DW_AT_specification attribute for member functions of a funcation local class. This trips gdb's partial scan of DIEs at load time. Fixes Radar 7833483.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 23:53:48 +00:00
John McCall
795ee9dd1e Fix a number of clang -Wsign-compare warnings that didn't have an obvious
solution.  The only reason these don't fire with gcc-4.2 is that gcc turns off
part of -Wsign-compare in C++ on accident.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 23:35:53 +00:00
Dale Johannesen
49d915bb9a Revert 100573, it's causing some testsuite problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 22:45:26 +00:00
Dale Johannesen
0a580d30e0 Move printing of DEBUG_VALUE comments to target-independent place.
There is probably a more elegant way to do this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 22:21:07 +00:00
Dale Johannesen
c4d7b14a92 Allow for the possibility that a debug-value points
to a SDNode that didn't have code generated for it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100566 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 21:59:56 +00:00
Stuart Hastings
639336e0bd Reverting 100530 & 100531 due to regressions in the GDB test suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 21:38:29 +00:00
Evan Cheng
98116f99b6 Code clean up. Move includes from VirtRegRewriter.h to VirtRegRewriter.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:19:55 +00:00
Stuart Hastings
983327b351 Revise debug info machinery to digest nested functions and classes.
A certain GDB testsuite case (local.cc) has a function nested inside a
class nested inside another function.  GCC presents the innermost
function to llvm-convert first.  Heretofore, the debug info mistakenly
placed the inner function at module scope.  This patch walks the GCC
context links and instantiates the outer class and function so the
debug info is properly nested.  Radar 7426545.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100530 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:19:32 +00:00
Mon P Wang
01f0e8561d Remove assert to treat memmove and memset like memcpy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 08:27:51 +00:00
Chris Lattner
885d94143d propagate cookie management out one layer of function calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 00:58:50 +00:00
Chris Lattner
6eb7806a5f report errors through LLVMContext's inline asm handler if available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 00:55:39 +00:00
Chris Lattner
421ccd9892 Give MachineModuleInfo an actual Module*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 00:51:52 +00:00
Devang Patel
f778b57fc5 Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100505 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 00:38:32 +00:00
Evan Cheng
18141eed26 Fix an obvious copy-n-paste bug. It's not known to cause any miscompilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:33:29 +00:00
Chris Lattner
79180e2ef5 Give AsmParser an option to control whether it finalizes
the stream.  New demo:

$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
$ otool -tv t.o
t.o:
(__TEXT,__text) section
_foo:
0000000000000000	subq	$0x08,%rsp
0000000000000004	movl	%edi,(%rsp)
0000000000000007	movl	%edi,%eax
0000000000000009	incl	%eax
000000000000000b	movl	%eax,(%rsp)
000000000000000e	movl	%eax,0x04(%rsp)
0000000000000012	addq	$0x08,%rsp
0000000000000016	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:15:42 +00:00
Chris Lattner
af632c91a0 add .o file writing for inline asm in llc. Here's a silly
demo:

$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
<inline asm>:1:2: error: unrecognized instruction
	abc incl    %eax
	^
LLVM ERROR: Error parsing inline asm

Only problem seems to be that the parser finalizes OutStreamer 
at the end of the first inline asm, which isn't what we want.
For example:

$ cat asm.c
int foo(int X) {
 __asm__ ("incl    %0" : "+r" (X));
 return X;
}
$ clang asm.c -S -o - -emit-llvm | llc
...
	subq	$8, %rsp
	movl	%edi, (%rsp)
	movl	%edi, %eax
	## InlineAsm Start
	incl    %eax
	## InlineAsm End
	movl	%eax, (%rsp)
	movl	%eax, 4(%rsp)
	addq	$8, %rsp
	ret
$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
$ otool -tv t.o
t.o:
(__TEXT,__text) section
_foo:
0000000000000000	subq	$0x08,%rsp
0000000000000004	movl	%edi,(%rsp)
0000000000000007	movl	%edi,%eax
0000000000000009	incl	%eax
$ 

don't stop at inc!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:11:24 +00:00
Bill Wendling
57fbba4dba Output floating point representations in DWARF format. This is done by outputing
the FP encoding directly as a hex representation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:59:21 +00:00
Chris Lattner
4c842dda39 stringref-ize the MemoryBuffer::get apis. This requires
a co-committed clang patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:42:30 +00:00
Dan Gohman
7b55d3665c Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 20:24:08 +00:00
Chris Lattner
5c06a20814 lowering a volatile llvm.memcpy to a libc memcpy is ok.
PR6779


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 20:11:45 +00:00
Dan Gohman
c4ae94dee8 Don't do code sinking on unreachable blocks. It's unprofitable and hazardous.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 19:17:22 +00:00
Chris Lattner
512063dd0f remove the now-redundant MMI pointer in SelectionDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 06:19:28 +00:00
Chris Lattner
d2c4f19a9f hopefully sate the clang self host build, which is apparently
instantiating some folding set stuff that GCC isn't, requiring 
some types to not be incomplete.

I don't know if clang is right or wrong, but unbreaking the
bot is goodness.  Here's the broken build:
http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/1813/steps/compile.llvm.stage2/logs/stdio


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 06:12:01 +00:00
Chris Lattner
de6e783b24 remove some redundant MMI arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 06:10:13 +00:00
Chris Lattner
ed3a8067a6 unthread MMI from FastISel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 06:05:26 +00:00
Chris Lattner
a267b0076e remove the MMI pointer from MachineFrameInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:57:52 +00:00
Chris Lattner
820e55e9ad enhance MachineFunction to have a MMI pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:49:50 +00:00
Chris Lattner
2b1b3312e0 privatize more stuff, eliminate vtables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:32:45 +00:00
Chris Lattner
105d697593 reprivatize now that DwarfWriter is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:31:04 +00:00
Chris Lattner
6d7337896f prune #includes, MMI can never be null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:28:23 +00:00
Chris Lattner
74e41f9821 prune #includes, realize the MMI can never be null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100407 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:24:55 +00:00
Chris Lattner
493c9765e0 finally blast DwarfWriter away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:12:59 +00:00
Chris Lattner
49cd6649e1 change AsmPrinter to use DwarfDebug/DwarfException directly
instead of going through DwarfWriter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:11:15 +00:00
Chris Lattner
ea761868b5 trim some spurious references to DwarfWriter. SDIsel really doesn't
need it anymore, so don't addRequire it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 04:09:20 +00:00
Chris Lattner
994cb126c9 eliminate DwarfDebug::shouldEmit, which is the same now as MMI::hasDebugInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 03:52:55 +00:00
Chris Lattner
6342b416f3 fix a regression on 2009-08-17-DebugInfo.m
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 03:49:26 +00:00
Chris Lattner
ba79d72eab selection dag doesn't need DwarfWriter, remove some tendrils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 02:23:33 +00:00
Chris Lattner
d850ac79b5 fastisel doesn't need DwarfWriter, remove some tendricles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100381 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 02:19:28 +00:00
Chris Lattner
90429c487f just have all targets create the DwarfWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 00:42:55 +00:00
Chris Lattner
505e86832a nuke DwarfPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 00:27:29 +00:00
Chris Lattner
84ac8b7f43 make DwarfException not inherit from DwarfPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 00:26:50 +00:00
Chris Lattner
a37d5387a5 change SizeOf to take AsmPrinter instead of TargetData,
simplifying a bunch of code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100373 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 00:18:22 +00:00
Chris Lattner
d38fee8ddc 1) make DIE take AsmPrinter instead of DwarfPrinter.
2) change DwarfDebug to not inherit from DwarfPrinter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 00:13:49 +00:00
Chris Lattner
02b86b93dc Move EmitFrameMoves into AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100371 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 23:41:46 +00:00
Chris Lattner
786d17a0cf simplify code and reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 23:31:58 +00:00
Chris Lattner
6189ed10c1 now that the magic is dispelled, move EmitSectionOffset to AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 23:25:33 +00:00
Chris Lattner
3d22513611 eliminate the magic AbsoluteDebugSectionOffsets MAI hook,
which is really a property of the section being referenced.
Add a predicate to MCSection to replace it.

Yay for reduction in magic.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100367 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 23:22:29 +00:00
Chris Lattner
be15beb54a only emit section labels if we have debug info, fixing a few
regtest failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 23:17:54 +00:00
Chris Lattner
4ad1efec92 I was wrong, ocaml isn't referencing 'Ldata_begin', so remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100365 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 23:10:38 +00:00
Chris Lattner
a33b2a1ee6 add some assertions to EmitSectionOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 23:06:31 +00:00
Chris Lattner
11b8f30567 stop emitting some dead L labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 23:02:02 +00:00
Chris Lattner
9c69e28553 Store an use the symbols emitted at the start of the debug
sections instead of magically rematerializing them later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 22:59:04 +00:00
Chris Lattner
fa070b0175 remove the didInitial ivar, rename emitInitial to be more
descriptive, change EmitSectionOffset back to taking a
symbol instead of a string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 22:33:59 +00:00
Chris Lattner
2e3ebedc88 simplify EmitSectionOffset a little bit, improve comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 22:25:14 +00:00
Chris Lattner
83d1618b46 The "IsSmall" argument to EmitSectionOffset is always true,
constant fold it away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 21:34:40 +00:00
Chris Lattner
f88dce1f89 eliminate the "isEH" argument to EmitSectionOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 21:31:54 +00:00
Chris Lattner
0887fa0b8c isAbsoluteEHSectionOffsets always returns false, eliminate it
and substitute false at the one call site.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 21:29:44 +00:00
Chris Lattner
d2af7853e3 move some more stuff to asmprinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 20:20:50 +00:00
Chris Lattner
9be4913136 simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 20:10:41 +00:00
Chris Lattner
ca6190b108 move EmitEncodingByte to AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 20:04:21 +00:00
Chris Lattner
7a101f45c1 move EmitCFAByte to AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 20:01:25 +00:00
Chris Lattner
a64371828e inline EmitDifference away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 19:58:12 +00:00
Chris Lattner
af8df26495 resolve a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 19:28:59 +00:00
Chris Lattner
c021572511 move gettemplabel and getdwlabel to AsmPrinter and rename
them for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 19:25:43 +00:00
Chris Lattner
7e1a8f882f move uleb/sleb printing into AsmPrinter from DwarfPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 19:09:29 +00:00
Chris Lattner
17fedf216b more interface cleanup make some helpers static functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100343 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:58:53 +00:00
Chris Lattner
3f53c8398d clean up the asmprinter header and privatize some stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:52:31 +00:00
Chris Lattner
65eeaad91d use stringref instead of strtol to avoid errno gymnastics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:42:18 +00:00
Chris Lattner
736e31d0cf split inline asm support out to its own .cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:34:07 +00:00
Chris Lattner
285199502b inline processDebugLoc and simplify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:18:51 +00:00
Chris Lattner
dfa107e45a minor tidying.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:16:38 +00:00
Chris Lattner
300a4c5640 clean up the asmprinter interface a bit, rename a few
"Print" methods to "Emit".  Emit is something that goes
to an mc streamer, Print is something that goes to a
raw_ostream (for inline asm) 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:14:01 +00:00
Chris Lattner
9d1c1ada21 remove TargetMachine.h #include, also, TRI isn't used frequently
enough to warrant caching in AsmPrinter, so remove it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:06:11 +00:00
Chris Lattner
e00b59f954 lazily allocate the GCMetadataPrinters map and remove DenseMap
from the AsmPrinter interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 17:57:56 +00:00
Chris Lattner
b23569aff0 Momentous day: remove the "O" member from AsmPrinter. Now all
"asm printering" happens through MCStreamer.  This also 
Streamerizes PIC16 debug info, which escaped my attention.

This removes a leak from LLVMTargetMachine of the 'legacy'
output stream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100327 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 08:18:47 +00:00
Chris Lattner
de0f339ec3 now that all operand printing happens to specified streams, we can
print function level inline asm with EmitInlineAsm instead of writing
it directly to "O".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100326 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:50:12 +00:00
Chris Lattner
75f50725c1 remove the raw_ostream from various dwarf printing things.
The only thing left is LEB printing, which uses EmitRawText
for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100325 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:48:20 +00:00
Chris Lattner
7d73c7f0d6 mcize the gc metadata printing stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:39:04 +00:00
Chris Lattner
0b9bdb47bd use EmitRawText instead of O in DwarfPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:25:52 +00:00
Chris Lattner
c75c028a15 fix PrintAsmOperand and PrintAsmMemoryOperand to pass down
raw_ostream to print to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100313 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:29:35 +00:00
Chris Lattner
d32c8a5617 change this back too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:09:10 +00:00
Chris Lattner
e1783cadf7 check in what I tested. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:08:10 +00:00
Chris Lattner
c1e0b76306 MMI is always available, rename O -> OS in printInlineAsm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:07:45 +00:00
Chris Lattner
d374087be5 fix an ugly wart in the MCInstPrinter api where the
raw_ostream to print an instruction to had to be specified
at MCInstPrinter construction time instead of being able
to pick at each call to printInstruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:04:31 +00:00
Chris Lattner
35c33bd772 change a ton of code to not implicitly use the "O" raw_ostream
member of AsmPrinter.  Instead, pass it in explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 04:47:45 +00:00
Mon P Wang
20adc9dc46 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100304 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 03:10:48 +00:00
Chris Lattner
0c08d09204 asmstreamerize the .size directive for function bodies, force clients
of printOffset to pass in a stream to print to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:28:33 +00:00
Chris Lattner
fd60b8b484 emit the cygwin stub thing through mcstreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:19:41 +00:00
Chris Lattner
58bc4dd4a9 add a twine form of MCStreamer::EmitRawText, and mc'ize
a few more things in AsmPrinter.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:12:35 +00:00
Chris Lattner
f94f8dcda7 start moving towards emitting inline asm statements with
EmitInlineAsm.  However, this attempt is foiled by operands
being emitted directly to "O" so I'll have to do some surgery
and finish MCizing the world.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:01:50 +00:00
Chris Lattner
91bead7905 add a new EmitInlineAsm function to asmprinter to handle inline asm.
If we have an MCAsmStreamer, we continue to emit asm textually, 
otherwise we (currently) emit an error to errs and ignore it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:35:55 +00:00
Chris Lattner
47b7e5dae9 mc'ize comment printing around file scope inline asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100288 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:13:18 +00:00
David Greene
5c8aa950fe Ok, third time's the charm. No changes from last time except the CMake
source addition.  Apparently the buildbots were wrong about failures.

---

Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100249 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 23:17:14 +00:00
Dale Johannesen
7249ef0455 Skip debug info when looking for existing EH calls at the
beginning of a block.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100230 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 21:49:27 +00:00
Benjamin Kramer
fd919200d4 Fix anachronism.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:47:05 +00:00
Chris Lattner
42f95ca96b fix the llvm-x86_64-linux buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:36:25 +00:00
Chris Lattner
457c6c5ccb remove empty file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:26:36 +00:00
Chris Lattner
a4f2bb08de stop using DebugLoc::getUnknownLoc()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:17:23 +00:00
Chris Lattner
de4845c163 Switch the code generator (except the JIT) onto the new DebugLoc
representation.  This eliminates the 'DILocation' MDNodes for 
file/line/col tuples from -O0 -g codegen.

This remove the old DebugLoc class, making it a typedef for DebugLoc,
I'll rename NewDebugLoc next.

I didn't update the JIT to use the new apis, so it will continue to
work, but be as slow as before.  Someone should eventually do this
or, better yet, rip out the JIT debug info stuff and build the JIT
on top of MC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:42:39 +00:00
Evan Cheng
f28f8bc40e Correctly lower memset / memcpy of undef. It should be a nop. PR6767.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100208 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:36:14 +00:00
Evan Cheng
cf5862d8ac Revert 100204. It broke a bunch of tests and apparently changed what passes are run during codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:29:15 +00:00
Benjamin Kramer
d0327f80ec Update CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100206 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:09:51 +00:00
David Greene
434bd8551d Let's try this again. Re-apply 100143 including an apparent missing
<string> include.  For some reason the buildbot choked on this while my
builds did not.  It's probably due to a difference in system headers.

---

Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:46:26 +00:00
Mon P Wang
e754d3fb85 Revert r100191 since it breaks objc in clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:43:02 +00:00
Mon P Wang
e33c848fa4 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:04:15 +00:00
Evan Cheng
db8771af28 After trivial coalescing, the MI being visited may have become a copy. Avoid adding it to CSE hash table since copies aren't being considered for CSE and they may be deleted.
rdar://7819990


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 02:21:24 +00:00
Dale Johannesen
93d6a7e9c2 Teach AnalyzeBranch, RemoveBranch and the branch
folder to be tolerant of debug info following the
branch(es) at the end of a block.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 01:38:09 +00:00
Eric Christopher
1d8f83d0a0 Revert r100143.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 22:54:42 +00:00
Devang Patel
c8e77640a5 Revert r100117.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 22:47:29 +00:00
David Greene
8ef3acba00 Add some switches helpful for debugging:
-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 22:43:57 +00:00
Devang Patel
24c20e2435 Do not eagerly record known previous location. DBG_VALUE may not cause a new label due to one or other reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:22:44 +00:00
Evan Cheng
6cdb7e22aa Skip checking preferred alignment of GVs defined in other translation units all together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:13:28 +00:00
Evan Cheng
94107ba9ce - Avoid using floating point stores to implement memset unless the value is zero.
- Do not try to infer GV alignment unless its type is sized. It's not possible to infer alignment if it has opaque type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 18:19:11 +00:00
Devang Patel
58c7aa61d4 Skip instructions until new scope is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 17:32:01 +00:00
Devang Patel
8935d90a90 Cosmetic changes.
Update comment, rename a local variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 17:16:48 +00:00
Evan Cheng
255f20f7f7 Fix sdisel memcpy, memset, memmove lowering:
1. Makes it possible to lower with floating point loads and stores.
2. Avoid unaligned loads / stores unless it's fast.
3. Fix some memcpy lowering logic bug related to when to optimize a
   load from constant string into a constant.
4. Adjust x86 memcpy lowering threshold to make it more sane.
5. Fix x86 target hook so it uses vector and floating point memory
   ops more effectively.
rdar://7774704


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 06:04:33 +00:00
Bill Wendling
e543d161a0 Reapply r100056. It doesn't look like it's the one that's causing a failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 00:00:43 +00:00
Bill Wendling
9e9cca424c Revert r100056. It was causing a failure on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 23:26:26 +00:00
Stuart Hastings
f8df814869 Reverting 100048; it broke two Frontend debug info tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 23:08:46 +00:00
Bill Wendling
bbd51cd0a1 Rewrite CorrectExtraCFGEdges() to make it more understandable.
* Set the "DestA" and "DestB" according to how they're understood by the
  method. I.e., if one or both of them should point to the "fall through" block,
  then point to the fall through block.

* Improve the loop that removes superfluous edges to be more understandable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 22:54:38 +00:00
Stuart Hastings
a88cb38d02 Debug info can now properly represent functions inside classes inside other functions. Partial fix for Radar 7424645.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 21:10:54 +00:00
Benjamin Kramer
bbb88db993 Reduce string trashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 20:15:45 +00:00
Benjamin Kramer
345ef343cc DwarfDebug: Allocate DIEValues with a BumpPtrAllocator. Most of them are
POD-like anyway, so we don't even care about calling their d'tors (DIEBlock
being the exception).

~6% less mallocs and ~1% compile time improvement on clang -O0 -g oggenc.c



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 19:34:01 +00:00
Chris Lattner
cfd3188a11 reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 06:09:04 +00:00
Chris Lattner
1d65ba732c tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 06:06:37 +00:00
Chris Lattner
ff741ab709 MI != 0 is checked in the assert right above this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:42:48 +00:00
Chris Lattner
14d750d0ad use the isDebugValue() predicate and pop_back_val()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:39:57 +00:00
Chris Lattner
ed7a77bfb2 assert is a function-like macro, not a control flow operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:36:29 +00:00
Chris Lattner
4dd8163091 reduce indentation, fit in 80 cols and various other cosmetic cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:15:22 +00:00
Chris Lattner
23dbf6683b use the optimized debug info apis in sdisel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 04:24:50 +00:00
Chris Lattner
870cfcf9a6 add new apis for getting/setting !dbg metadata on
instructions.  In addition to being a convenience,
they are faster than the old apis, particularly when
not going from an MDKindID like people should be
doing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 03:34:40 +00:00
Bob Wilson
100f090add Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:27:04 +00:00
Devang Patel
722f2290b8 Ignore invalid metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:09:52 +00:00
Mon P Wang
808bab0169 Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 20:55:56 +00:00
Benjamin Kramer
991de14dd6 Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
only a single type of object to be allocated. Use it to make VNInfo destruction
typesafe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 20:16:45 +00:00
Chris Lattner
9b97a73ded Rip out the 'is temporary' nonsense from the MCContext interface to
create symbols.  It is extremely error prone and a source of a lot
of the remaining integrated assembler bugs on x86-64.

This fixes rdar://7807601.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:10:53 +00:00
Evan Cheng
87bd191602 Funky indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:08:53 +00:00
Devang Patel
7ed6311577 There is no need to fall through after processing DBG_VALUE machine instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:07:00 +00:00
Daniel Dunbar
7a8cf2822d Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 17:57:42 +00:00
Torok Edwin
01cb1b665d Reapply r99881 with some fixes: only call destructor in releaseMemory!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 11:17:48 +00:00
Torok Edwin
226dd2ba99 Revert 99881, it brooke smooshlab's llvm-gcc-i386-darwin9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99882 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 10:25:08 +00:00
Torok Edwin
2a22004f68 Introduce another Reset() method in BumpPtrAllocator that calls a destructor
on all objects it has allocated, if they are all of the same size and alignment.
Use this to destruct all VNInfos allocated in LiveIntervalAnalysis (PR6653).

valnos is not reliable for this purpose, as seen in r99400
(which still leaked, and sometimes caused double frees).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 10:08:26 +00:00
Evan Cheng
28a1e48690 Avoid being influenced by the presence of dbg_value instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 05:49:07 +00:00
Bill Wendling
201f5f039f Re-add back in the slow way of determining of a clean-up should become a
catch-all. The "dominates" way won't catch all of the selectors which must be
changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 23:37:07 +00:00
Bill Wendling
bfde644e8a A more general (and simpler!) implementation of r99671. It performs a similar
transform. I.e., if a clean-up eh.selector call dominates the invoke of an
_Unwind_Resume_or_Rethrow, then we convert the eh.selector into a
catch-all. This patch, however, uses the DominatorTree information, and doesn't
go through the whole rigmarole of starting at the eh.exception call, finding the
corresponding URoR and eh.selector calls, and trying to trace through any number
of instruction types to get to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 23:02:46 +00:00
Devang Patel
aead63c033 Encode start location of debug value, communicated through DBG_VALUE machine instruction, in a variable's DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 22:59:58 +00:00
Evan Cheng
8e36a5c960 Fix PR4975. Avoid referencing empty vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 21:27:30 +00:00
Evan Cheng
31441b7e95 Pool allocate SDDbgValue nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 20:48:30 +00:00
Chris Lattner
c3b228c978 use RAII for ExceptionTimer too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 20:39:38 +00:00
Chris Lattner
a909d66351 fix a variety of issues were we'd start DebugTimer but
not stop it by using RAII.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 20:38:20 +00:00
Devang Patel
553881bddc Refactor code to push DILocation prcessing into DwarfDebug.cpp from AsmPrinter.cpp.
This is same as r99772 (which was reverted) with just one meaningful difference where two source lines exchanged their positions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 17:20:31 +00:00
Devang Patel
de9b1efbe5 Revert 99772.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 21:23:37 +00:00
Chris Lattner
bed993d8a4 add a statistic for the # times isel has to backtrack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 19:46:56 +00:00
Devang Patel
c7eae5ca4a Refactoring. Push DILocation processing in to DwarfDebug from AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 18:57:09 +00:00
Chris Lattner
caa8870fe0 finally remove the immAllOnesV_bc/immAllZerosV_bc patterns
and those derived from them.  These are obnoxious because
they were written as: PatLeaf<(bitconvert).  Not having an
argument was foiling adding better type checking for operand
count matching up with what was required (in this case,
bitconvert always requires an operand!)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 08:43:23 +00:00
Chris Lattner
5d9a1bce83 comply with the wishes of a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 05:55:17 +00:00
Chris Lattner
b0e483e2c4 now that (parallel) is gone and a variety of bugs in targets
are cleaned up, we can remove an old fixme.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 05:54:03 +00:00
Chris Lattner
aa4e3391c8 add an optimized form of OPC_EmitMergeInputChains for the 1, 0 and
1, 1 cases which are by-far the most frequent.  This shrinks the X86
isel table from 77014 -> 74657 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 05:50:16 +00:00
Chris Lattner
856fb395e4 don't add nodes to the now-dead nodes list multiple times, this
can cause a crash on crazy situations in msp430 when morph-node-to
is disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99739 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 05:28:31 +00:00
Chris Lattner
19e37cbf4f don't add flag nodes with chain results to the NowDeadNodes
list multiple times when MorphNodeTo can't be applied.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 04:54:33 +00:00
Chris Lattner
a6f8693385 improve -debug-only=isel comments for cases when we don't enter a
scope due to obviously false predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 18:54:50 +00:00
Bill Wendling
e6b293b78d Forgot the part where we handle the ".llvm.eh.catch.all.value".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99697 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 01:24:30 +00:00
Bill Wendling
43de15f8a3 Return if we changed anything or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 01:22:38 +00:00
Bill Wendling
bfbd853958 If a selector has a call to ".llvm.eh.catch.all.value" that we haven't
converted, then use the initializer, since using the name itself won't work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 01:19:12 +00:00
Bill Wendling
2ad4aca8b2 If we mark clean-ups as clean-ups, then it could break when inlining through an
'invoke' instruction. You will get a situation like this:

bb:
  %ehptr = eh.exception()
  %sel = eh.selector(%ehptr, @per, 0);

...

bb2:
  invoke _Unwind_Resume_or_Rethrow(%ehptr) %normal unwind to %lpad

lpad:
  ...

The unwinder will see the %sel call as a clean-up and, if it doesn't have a
catch further up the call stack, it will skip running it. But there *is* another
catch up the stack -- the catch for the %lpad. However, we can't see that. This
is fixed in code-gen, where we detect this situation, and convert the "clean-up"
selector call into a "catch-all" selector call. This gives us the correct
semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 23:41:30 +00:00
Anton Korobeynikov
de0118c324 Add few missed libcalls and correct names for others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 21:32:14 +00:00
Dale Johannesen
4d12d3b70f Debug info shouldn't affect kills.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 19:21:26 +00:00
Evan Cheng
d05e805536 LiveVariables should clear kill / dead markers first. This allows us to remove a hack in the scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 02:12:24 +00:00
Evan Cheng
9f68948609 Try trivial remat before the coalescer gives up on a vr / physreg coalescing for fear of tying up a physical register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 00:07:25 +00:00
Dale Johannesen
1feeadac1b Handle DEBUG_VALUE in this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 00:02:44 +00:00
Evan Cheng
460e479b19 Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99544 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 19:46:11 +00:00
Chris Lattner
7bf198fd60 fix a valgrind error on copy-constructor-synthesis.cpp, which is caused when
the custom insertion hook deletes the instruction, then we try to set dead
flags on it.  Neither the code that I added nor the code that was there 
before was safe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 18:49:10 +00:00
Evan Cheng
fd59f4cd3d Remove an unused option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99537 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 18:37:23 +00:00
Devang Patel
2ddefecfa0 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 15:09:44 +00:00
Evan Cheng
4ec9bd9a6f Scheduler assumes SDDbgValue nodes are in source order. That's true currently. But add an assertion to verify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99501 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 07:16:57 +00:00
Chris Lattner
d5d5a3dcba Change tblgen to emit FOOISD opcode names as two
bytes instead of one byte.  This is important because
we're running up to too many opcodes to fit in a byte
and it is aggrevated by FIRST_TARGET_MEMORY_OPCODE
making the numbering sparse.  This just bites the
bullet and bloats out the table.  In practice, this
increases the size of the x86 isel table from 74.5K
to 76K.  I think we'll cope :)

This fixes rdar://7791648


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 06:33:05 +00:00
Evan Cheng
167bda4baa Remove a fixme that doesn't make sense any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 06:02:53 +00:00
Evan Cheng
c388ace6f9 Make sure SDDbgValue.Invalid is initialized to false by all the constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 05:50:26 +00:00
Chris Lattner
47cdf4abff Make the NDEBUG assertion stronger and more clear what is
happening.

Enhance scheduling to set the DEAD flag on implicit defs
more aggressively.  Before, we'd set an implicit def operand
to dead if it were present in the SDNode corresponding to
the machineinstr but had no use.  Now we do it in this case
AND if the implicit def does not exist in the SDNode at all.

This exposes a couple of problems: one is the FIXME, which
causes a live intervals crash on CodeGen/X86/sibcall.ll.
The second is that it makes machinecse and licm more 
aggressive (which is a good thing) but also exposes a case
where licm hoists a set0 and then it doesn't get resunk.

Talking to codegen folks about both these issues, but I need
this patch in in the meantime.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 05:40:48 +00:00
Chris Lattner
3d7d07ef03 reapply 99444/99445, which I speculatively reverted in
r99453.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99482 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 04:41:16 +00:00
Evan Cheng
bfcb305189 Change how dbg_value sdnodes are converted into machine instructions. Their placement should be determined by the relative order of incoming llvm instructions. The scheduler will now use the SDNode ordering information to determine where to insert them. A dbg_value instruction is inserted after the instruction with the last highest source order and before the instruction with the next highest source order. It will optimize the placement by inserting right after the instruction that produces the value if they have consecutive order numbers.
Here is a theoretical example that illustrates why the placement is important.

tmp1 = 
store tmp1 -> x
...
tmp2 = add ...
...
call
...
store tmp2 -> x

Now mem2reg comes along:

tmp1 = 
dbg_value (tmp1 -> x)
...
tmp2 = add ...
...
call
...
dbg_value (tmp2 -> x)

When the debugger examine the value of x after the add instruction but before the call, it should have the value of tmp1.

Furthermore, for dbg_value's that reference constants, they should not be emitted at the beginning of the block (since they do not have "producers").

This patch also cleans up how SDISel manages DbgValue nodes. It allow a SDNode to be referenced by multiple SDDbgValue nodes. When a SDNode is deleted, it uses the information to find the SDDbgValues and invalidate them. They are not deleted until the corresponding SelectionDAG is destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:38:16 +00:00
Evan Cheng
48f2cb926e Avoid being influenced by dbg_value instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:01:37 +00:00
Chris Lattner
d41952da10 revert 99444/99445. This doesn't cause the failure of
2006-07-19-stwbrx-crash.ll for me, but it's the only likely
patch in the blame list of several bots.  Lets see if this
fixes it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:41:19 +00:00
Chris Lattner
4020670195 remove dead argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:47:12 +00:00
Chris Lattner
c243dea003 split EmitNode in half to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:45:47 +00:00
Devang Patel
9bb59a2bdc Use SP filename directly instead of SP's context's filename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 21:30:35 +00:00
Bob Wilson
d6a6b3b756 Revert Edwin's change that is breaking MultiSource/Applications/ClamAV/clamscan.
--- Reverse-merging r99400 into '.':
D    test/CodeGen/Generic/2010-03-24-liveintervalleak.ll
U    lib/CodeGen/LiveIntervalAnalysis.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 20:25:25 +00:00
Torok Edwin
15417383b9 Fix memory leak in liveintervals: the destructor for VNInfos must be called,
otherwise the SmallVector it contains doesn't free its memory.
In most cases LiveIntervalAnalysis could get away by not calling the destructor,
because VNInfos are bumpptr-allocated, and smallvectors usually don't grow.
However when the SmallVector does grow it always leaks.

This is the valgrind shown leak from the original testcase:
==8206== 18,304 bytes in 151 blocks are definitely lost in loss record 164 of 164
==8206==    at 0x4A079C7: operator new(unsigned long) (vg_replace_malloc.c:220)
==8206==    by 0x4DB7A7E: llvm::SmallVectorBase::grow_pod(unsigned long, unsigned long) (in /home/edwin/clam/git/builds/defaul
t/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4F90382: llvm::VNInfo::addKill(llvm::SlotIndex) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libcl
amav.so.6.1.0)
==8206==    by 0x5126B5C: llvm::LiveIntervals::handleVirtualRegisterDef(llvm::MachineBasicBlock*, llvm::ilist_iterator<llvm::M
achineInstr>, llvm::SlotIndex, llvm::MachineOperand&, unsigned int, llvm::LiveInterval&) (in /home/edwin/clam/git/builds/defau
lt/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x512725E: llvm::LiveIntervals::handleRegisterDef(llvm::MachineBasicBlock*, llvm::ilist_iterator<llvm::MachineI
nstr>, llvm::SlotIndex, llvm::MachineOperand&, unsigned int) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav
.so.6.1.0)
==8206==    by 0x51278A8: llvm::LiveIntervals::computeIntervals() (in /home/edwin/clam/git/builds/default/libclamav/.libs/libc
lamav.so.6.1.0)
==8206==    by 0x5127CB4: llvm::LiveIntervals::runOnMachineFunction(llvm::MachineFunction&) (in /home/edwin/clam/git/builds/de
fault/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAE935: llvm::FPPassManager::runOnFunction(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclama
v/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAEB10: llvm::FunctionPassManagerImpl::run(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclama
v/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAED3D: llvm::FunctionPassManager::run(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclamav/.l
ibs/libclamav.so.6.1.0)
==8206==    by 0x4D8BE8E: llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4D8CA72: llvm::JIT::getPointerToFunction(llvm::Function*) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav.so.6.1.0)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 13:50:36 +00:00
Evan Cheng
2250425d6e dbg_value may end a block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 01:50:28 +00:00
Dan Gohman
0f920e55fc Remove the ConvertActions table and associated code, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:53:38 +00:00
Dan Gohman
bc7a902713 Revert 99335. getTypeToExpandTo's iterative behavior is actually
needed here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 22:44:42 +00:00
Dan Gohman
349074896f Remove getTypeToExpandTo, since it isn't adding much value
beyond just calling getTypeToTransformTo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 22:15:31 +00:00
Evan Cheng
f1250eeadf Ignore dbg_value's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99321 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 20:36:12 +00:00
Evan Cheng
112e5e7eff Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 20:33:48 +00:00
Chris Lattner
ea16ea5901 Fix PR6673: updating the callback should not clear the map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:15:57 +00:00
Devang Patel
4a602caf2e Emit DW_AT_low_pc and DW_AT_high_pc attributes for TAG_compile_unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:11:36 +00:00
Devang Patel
0493f95a2c DW_AT_stmt_list attribute attached with a compile unit encodes offset of line number information for this compile unit in debug_line section. This offset is always zero when only one compile unit is emitted in a object file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 22:38:48 +00:00
Evan Cheng
a69ec09364 Reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 21:24:33 +00:00
Jeffrey Yasskin
638fe8dd62 Fix a memory leak from DIE::addSiblingOffset() by adding the DIEValue
it allocates to DwarfDebug::DIEValues.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 18:47:14 +00:00
Evan Cheng
fc91114a2e 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 18:40:50 +00:00
Jeffrey Yasskin
6b4c12db13 Free SavedLI even if SimpleRegisterCoalescing::JoinCopy() returns early.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 01:47:49 +00:00
Bob Wilson
80d23705e6 Stop trying to merge identical jump tables. This had been inadvertently
disabled for several months (since svn r88806) and no one noticed.  My fix
for pr6543 yesterday reenabled it, but broke the ARM port's code for using
TBB/TBH.  Rather than adding a target hook to disable merging for Thumb2 only,
I'm just taking this out.  It is not common to have identical jump tables,
the code we used to merge them was O(N^2), and it only helps code size, not
performance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 19:05:41 +00:00
Mon P Wang
c1e5d491a0 Fixed a widening bug where we were not using the correct size for the load
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 01:19:52 +00:00
Anton Korobeynikov
f0d500768d Get rid of target-specific nodes for fp16 <-> fp32 conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 22:35:37 +00:00
Dan Gohman
9553188fcc Define placement new wrappers for BumpPtrAllocator and
RecyclingAllocator to allow client code to be simpler, and
simplify several clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:49:47 +00:00
Bob Wilson
d1ec31dca5 Fix pr6543: svn r88806 changed MachineJumpTableInfo::getJumpTableIndex() to
always create a new jump table.  The intention was to avoid merging jump
tables in SelectionDAGBuilder, and to wait for the branch folding pass to
merge tables.  Unfortunately, the same getJumpTableIndex() method is also
used to merge tables in branch folding, so as a result of this change
branch tables are never merged.  Worse, the branch folding code is expecting
getJumpTableIndex to always return the index of an existing table, but with
this change, it never does so.  In at least some cases, e.g., pr6543, this
creates references to non-existent tables.

I've fixed the problem by adding a new createJumpTableIndex function, which
will always create a new table, and I've changed getJumpTableIndex to only
look at existing tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:42:41 +00:00
Dan Gohman
1584390e55 Add explicit braces to avoid ambiguous ‘else’.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:07:13 +00:00
Devang Patel
1ac2429d1f Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 16:41:16 +00:00
Jakob Stoklund Olesen
ec1176a206 Revert "Change coalescer complexity from N^2 to N logN by changing one letter."
This reverts commit 98776. It broke the llvm-gcc boot strap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:23:47 +00:00
Devang Patel
c3188ce0f1 Debug info intrinsic does not intefer during tail call optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 23:52:37 +00:00
Jakob Stoklund Olesen
0427b2ac45 Change coalescer complexity from N^2 to N logN by changing one letter.
Remove ugly hack that aborted the coalescer before using N^2 time.

This affects functions with very complicated live intervals for physical
registers, i.e. functions with thousands of function calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 23:21:58 +00:00
Devang Patel
5b33f3148c Fix EmitSectionOffset incorrect argument. DwarfDebug is emitting debug info so isEH is always false. This was hiding until now from compilers because of default arguments. This was hiding from dwarf debug info users because for most of the platform isAbsoluteEHSectionOffsets() is same as isAbsoluteDebugSectionOffsets(). But Chris found it while updating dwarf printer to use MC*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 17:29:55 +00:00
Chris Lattner
77e7694026 fix GetOrCreateTemporarySymbol to require a name, clients
should use CreateTempSymbol() if they don't care about the
name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 05:41:18 +00:00
Bob Wilson
a1bdfc3c7f Remove a check that can no longer be true, after r84803.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98694 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 23:40:32 +00:00
Evan Cheng
4507f089d4 Fix liveintervals handling of dbg_value instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 21:51:27 +00:00
Chris Lattner
93b122d3c4 reapply r98656 unmodified, which exposed the asmprinter not
handling constant unions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 21:25:55 +00:00
Devang Patel
cbe1e31732 Ignore debug value instructions while analyzing BB for tail duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 21:02:07 +00:00
Daniel Dunbar
b85c7100c5 Revert r98656, its breaking all over the place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 19:35:34 +00:00
Chris Lattner
8b3b34f410 improve support for uniontype and ConstantUnion, patch by Tim Northover!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 19:15:03 +00:00
Bill Wendling
b0d27662ea Use getFirstTerminator().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98604 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 02:01:51 +00:00
Bill Wendling
8fe347a8b5 When checking if something's killed, don't rely simply on whether it's marked as
"used outside of the block". If the block ends in a return, then it won't be
used outside of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98599 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 01:05:35 +00:00