Commit Graph

37886 Commits

Author SHA1 Message Date
Bob Wilson
d0910c4534 Expand SELECT and SELECT_CC for NEON vector types.
Radar 7770501.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100568 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 22:02:24 +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
Jim Grosbach
fa85eb6237 Fix PR6696 and PR6663
When a frame pointer is not otherwise required, and dynamic stack alignment
is necessary solely due to the spilling of a register with larger alignment
requirements than the default stack alignment, the frame pointer can be both
used as a general purpose register and a frame pointer. That goes poorly, for
obvious reasons. This patch brings back a bit of old logic for identifying
the use of such registers and conservatively reserves the frame pointer
during register allocation in such cases.

For now, implement for X86 only since it's 32-bit linux which is hitting this,
and we want a targeted fix for 2.7. As a follow-on, this will be expanded
to handle other targets, as theoretically the problem could arise elsewhere
as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100559 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 20:26:37 +00:00
Jakob Stoklund Olesen
8ba1c6ab87 Don't try to collapse DomainValues onto an incompatible SSE domain.
This fixes the Bullet regression on i386/nocona.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 19:48:56 +00:00
Gabor Greif
8a8a4350db performance: get rid of repeated dereferencing of use_iterator by caching its result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 19:32:30 +00:00
Gabor Greif
6ce02b5939 make more two predicates constant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 19:24:18 +00:00
Gabor Greif
a01d6db569 performance: get rid of repeated dereferencing of use_iterator by caching its result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 19:14:05 +00:00
Gabor Greif
0b520db74d const-ize predicate ValueIsOnlyUsedLocallyOrStoredToOneGlobal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 18:58:22 +00:00
Gabor Greif
fa1f5c22c5 use CallSite to access calls vs. invokes uniformly
and remove assumptions about operand order

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100544 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 18:45:08 +00:00
Chris Lattner
b019491b8d enhance SMDiagnostic to also maintain a pointer to the SourceMgr.
Add a simplified constructor for clients that don't have locations
like "file not found" errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 18:06:18 +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
Owen Anderson
ffb7312458 Use a ManagedCleanup to prevent leaking the PassRegistrar map. In breaks the
use case where someone wants to resurrect LLVM after calling llvm_shutdown,
but I'm not aware of any clients that are affected by this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 04:20:48 +00:00
Dan Gohman
3d32386992 Add a const qualifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 01:31:12 +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
Chris Lattner
42a4ee0a35 give LLVMContext an inline asm diagnostic hook member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 00:44:45 +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
Chris Lattner
214aa8a2cf give the SourceMgr object a cookie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 00:33:43 +00:00
Chris Lattner
8f0f480a10 Give llvm::SourceMgr the ability to have a client-specified
diagnostic handler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 00:26:48 +00:00
Jakob Stoklund Olesen
fc8e1c3635 Properly enable load clustering.
Operand 2 on a load instruction does not have to be a RegisterSDNode for this to
work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:48:02 +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
Evan Cheng
18ac410f4f Fix ADD32rr_alt instruction encoding bug. Patch by Marius Wachtler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:21:09 +00:00
Chris Lattner
e597f00e1a fix a really nasty bug that Evan was tracking in SCCP. When resolving
undefs in branches/switches, we have two cases: a branch on a literal
undef or a branch on a symbolic value which is undef.  If we have a
literal undef, the code was correct: forcing it to a constant is the
right thing to do.

If we have a branch on a symbolic value that is undef, we should force
the symbolic value to a constant, which then makes the successor block
live.  Forcing the condition of the branch to being a constant isn't 
safe if later paths become live and the value becomes overdefined.  This
is the case that 'forcedconstant' is designed to handle, so just use it.

This fixes rdar://7765019 but there is no good testcase for this, the
one I have is too insane to be useful in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:14:48 +00:00
Chris Lattner
9e185800c0 some code cleanups, use SwitchInst::findCaseValue, reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 21:18:32 +00:00
Evan Cheng
0f1666b480 Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 21:16:25 +00:00
Eric Christopher
b6290a170f Remove FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 21:14:32 +00:00
Jeffrey Yasskin
376ac434ad Fix OProfileJITEventListener build for new DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 21:09:12 +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
0333535054 don't use emitlabel in the arm asm printer yet, the order
isn't well specified.  ARM really needs to have its instprinter
finished at some point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 17:52:31 +00:00
Owen Anderson
d2520dcc70 Push const through the regex engine. Fixes some of the warnings in PR6616.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100438 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 17:50:20 +00:00
Chris Lattner
0752cda4de fix a couple problems I introduced handling symbols
with spaces in them.  Sym->getName()  !=   OS << *Sym




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 16:32:14 +00:00
Benjamin Kramer
75e818ad2f Disambiguate else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 10:17:15 +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
66f20c8e82 simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100412 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 05:48:36 +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
Johnny Chen
7fb053dd45 Get rid of traling whitespaces. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 04:51:50 +00:00
Johnny Chen
9d563b676c The disassembler impl. of MCDisassembler::getInstruction() was using the pattern
uint32_t insn;
  MemoryObject.readBytes(Address, 4, (uint8_t*)&insn, NULL)

to read 4 bytes of memory contents into a 32-bit uint variable.  This leaves the
interpretation of byte order up to the host machine and causes PPC test cases of
arm-tests, neon-tests, and thumb-tests to fail.  Fixed to use a byte array for
reading the memory contents and shift the bytes into place for the 32-bit uint
variable in the ARM case and 16-bit halfword in the Thumb case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 04:46:17 +00:00
Chris Lattner
d7d44bd5a8 implement EmitFunctionEntryLabel to emit the .cc_top directive,
allowing xcore to use the normal runOnMachineFunction 
implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 04:44:02 +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
0bcbe0e609 prune some #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 04:04:10 +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
Jakob Stoklund Olesen
fddb7667ca Replace TSFlagsFields and TSFlagsShifts with a simpler TSFlags field.
When a target instruction wants to set target-specific flags, it should simply
set bits in the TSFlags bit vector defined in the Instruction TableGen class.

This works well because TableGen resolves member references late:

class I : Instruction {
  AddrMode AM = AddrModeNone;
  let TSFlags{3-0} = AM.Value;
}

let AM = AddrMode4 in
def ADD : I;

TSFlags gets the expected bits from AddrMode4 in this example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 03:10:20 +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
Evan Cheng
cb86609421 Temporarily remove to disable building of ARM disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 01:57:50 +00:00
Evan Cheng
f6232cf8bb Re-apply 100265 but instead disable building of ARM disassembly for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 01:34:00 +00:00
Evan Cheng
1b0194d646 Reverting 100265 to try to get buildbots green again. Lots of self-hosting buildbots started complaining since this commit. Also xfail ARM disassembly tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 01:04:27 +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
8e680482c1 simplify various getAnalysisUsage implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 00:38:44 +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
1d20473c9d revert my patch, need to reconsider this and figure out what is really going on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 21:49:31 +00:00
Chris Lattner
4166047030 fix pasto, this is the wrong setting for arm elf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 21:37:20 +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
Jakob Stoklund Olesen
e0103f03f0 Clean up SSEDomainFix pass.
Restrict bit mask operations to the DomainValue class. Rename methods for
clarity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100353 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 21:27:26 +00:00
Chris Lattner
d290505f0f don't reset the default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100352 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 21:06:50 +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
Jakob Stoklund Olesen
bbef815a3b Switch SSEDomainFix to SpecificBumpPtrAllocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:00:21 +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
Nicolas Geoffray
9041ae274b CurFn is only used for relocations. Use EmissionDetails.MF->getFunction() instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100328 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 10:31:49 +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
73ce0a63e6 mc'ize the remaining uses of O.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100322 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:23:00 +00:00
Chris Lattner
1841b34f53 finish eliminating uses of O.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100321 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:17:25 +00:00
Chris Lattner
2dc6fa67ee mcize more of ppc stub printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100320 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:12:28 +00:00
Chris Lattner
9d7efd3081 mcize a bunch more stuff, using EmitRawText for things we
don't have mcstreamer support for yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:05:53 +00:00
Chris Lattner
7ad07c4636 convert the non-MCInstPrinter'ized EmitInstruction
implementations to use EmitRawText instead of writing
directly to "O".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100318 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 06:12:20 +00:00
Chris Lattner
f2777d7cd9 streamerize the rest of PIC16 asm printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100317 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:53:03 +00:00
Chris Lattner
1ce3f565ef streamerize printing of dbg_value, the x86 backend is now fully
streamerized for everything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100316 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:40:34 +00:00
Chris Lattner
bfbab35653 split DEBUG_VALUE printing stuff out to its own method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:38:19 +00:00
Chris Lattner
c82d9c4e5c mc'ize elf stub printing, convert cygwin stuff to EmitRawText,
which will abort in .o file writing mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:35:04 +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
e812d4c604 use predicates in DBG_VALUE printing code to simplify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:21:31 +00:00
Chris Lattner
88db786712 remove more implicit uses of "O".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100311 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:19:20 +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
d5928dcd78 allow attaching comments to raw text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:06:56 +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
3580dea910 add <cstdlib> header for abort() on linux builders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100290 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:48:59 +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
Chris Lattner
d52c072777 require that the branch being controlled by the IV
exits the loop.  With this information we can guarantee 
the iteration count of the loop is bounded by the 
compare.  I think this xforms is finally safe now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100285 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 07:21:39 +00:00
Chris Lattner
96fd76638b add integer overflow check for the fp induction variable
checker.  Amusingly, we already had tests that we should
have rejects because they would be miscompiled in the
testsuite.

The remaining issue with this is that we don't check that
the branch causes us to exit the loop if it fails, so we
don't actually know if we remain in bounds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 07:18:48 +00:00
Chris Lattner
bbb91498da add a comment and fix some consistency issues, converting
to a signed vs unsigned value depending on the sign of the
constant fp means that we can't distinguish between a 
truly negative number and a positive number so large the
32nd bit is set.  So, do don't this!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100283 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:41:49 +00:00
Chris Lattner
43b85273ee fix PR6761, a miscompilation due to the fp->int IV conversion
stuff.  More bugs remain though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:30:03 +00:00
Chris Lattner
a40e4a0c8a just eliminate the uitofp checks. This code isn't doing
the required validity checks in the first place, and supporting
a condition large enough to require the 32'nd bit isn't worth it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100280 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:25:21 +00:00
Chris Lattner
c91961e31b rename PH -> PN to be consistent with WeakPN and the rest
of llvm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100276 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:17:08 +00:00
Chris Lattner
70c0d4f7eb improve comment and drop a dead check. If PH had
no uses, it would have been deleted by 
RecursivelyDeleteTriviallyDeadInstructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100275 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:16:22 +00:00
Chris Lattner
9698c1985f strength reduce a ridiculous use of APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:13:12 +00:00
Chris Lattner
ca703bd56b rename stuff improve comment grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100273 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:11:07 +00:00
Chris Lattner
fa405af58a simplify some code and resolve a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:06:59 +00:00
Chris Lattner
c4f7e8061d There is no guarantee that the increment and the branch
are in the same block.  Insert the new increment in the
correct location.

Also, more cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:05:10 +00:00
Chris Lattner
07aa76ad93 first half of a pass through IndVarSimplify::HandleFloatingPointIV,
this cleans up a bunch of code and also fixes several crashes and
miscompiles.  More to come unfortunately, this optimization
is quite broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 05:54:59 +00:00
Chris Lattner
8e9c48a606 don't internalize available_externally functions, they are
really just declarations.  This is related to PR6524


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 05:24:50 +00:00
Johnny Chen
7fed809484 Get rid of the middleman (ARMAlgorithm), which causes more trouble than the
abstraction it brings.  And also get rid of the atexit() handler, it does not
belong in the lib directory. :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 04:10:56 +00:00
Bob Wilson
49c283fd3f Revert all my SSAUpdater patches. The PHI placement algorithm is not correct
(what was I thinking?) and there's also a problem with LCSSA.  I'll try again
later with fixes.

--- Reverse-merging r100263 into '.':
U    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100177 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100148 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100147 into '.':
U    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100131 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100130 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100126 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100050 into '.':
D    test/Transforms/GVN/2010-03-31-RedundantPHIs.ll
--- Reverse-merging r100047 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 03:50:38 +00:00
Bob Wilson
4cc3c26834 Add a DEBUG_TYPE for the SSAUpdater.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100263 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 03:28:44 +00:00
Evan Cheng
0272024210 Code refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 02:23:43 +00:00
Chris Lattner
a6245247e9 Add special case bitcode support for DebugLoc. This avoids
having the bitcode writer materialize mdnodes for all the
debug location tuples when writing out the bc file and 
stores the information in a more compact form.  For example,
the -O0 -g bc file for combine.c in 176.gcc shrinks from
739392 to 512096 bytes.

This concludes my planned short-term debug info work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 02:17:50 +00:00
Johnny Chen
b7aaed83e2 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 01:17:30 +00:00
Johnny Chen
b35ae7f7d6 Register ARMAlgorithm::DoCleanup() to be called on exit to free the memory
occuplied by the cached ARMAlgorithm objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 01:09:47 +00:00
Eric Christopher
b3500fd2f3 Rewrite aesimc handling. It only takes a single input and has a single
dest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 23:48:33 +00:00
Johnny Chen
a70261550e Fix another build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 23:43:38 +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
Johnny Chen
b68a3ee82a Second try of initial ARM/Thumb disassembler check-in. It consists of a tablgen
backend (ARMDecoderEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Reviewed by Chris Latter and Bob Wilson.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 22:27:38 +00:00
Sean Callanan
7626476733 Added support for reporting operand token ranges
to the ARM AsmParser.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100232 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 22:27:05 +00:00
Eric Christopher
6d1cd1cd04 Separate out the AES-NI instructions from the SSE4.2 instructions. Add
a new subtarget option for AES and check for the support.  Add "westmere"
line of processors and add AES-NI support to the core i7.

Add a couple of TODOs for information I couldn't verify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100231 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 21:54:27 +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
Sean Callanan
a144c3f34d Fixes to the X86 disassembler. The disassembler will now
return an error status in all failure cases, printing
messages to debugs() only when debugging is enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100229 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 21:23:51 +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
28a9bf67e2 DebugInfoFinder::processModule was foiling my plot by
materializing an MDNode for every debugloc.  don't do that! :)

"clang -g -S t.c" really no longer makes mdnodes for location 
tuples now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:44:29 +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
84e679beea rename NewDebugLoc -> DebugLoc, prune #includes in DebugLoc.h.
This keeps around temporary typedef for clang/llvm-gcc so the
build won't break when I commit this :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:21:22 +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
c7f3ace20c use DebugLoc default ctor instead of DebugLoc::getUnknownLoc()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:16:16 +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
Dan Gohman
d7bfd0028b Manually notify ScalarEvolution before making an operand replacement, since
it can't currently observe such changes automatically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 14:48:31 +00:00
Bob Wilson
6682048206 Recommit 100158 now that the buildbots are happy again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 05:09:46 +00:00
Eric Christopher
906af6f518 Remove FIXME - if there's a better way to do this it isn't here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 04:32:37 +00:00
Dan Gohman
f860db2398 Revert the recent alignment changes. They're broken for -Os because,
in particular, they end up aligning strings at 16-byte boundaries, and
there's no way for GlobalOpt to check OptForSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 03:04:37 +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
Chandler Carruth
ae1d41c8ae Disambiguate conditional expression for newer GCCs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 01:31:24 +00:00
Bob Wilson
5ea6352fcd Revert 100158 in case it is causing some of the buildbot problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 01:22:49 +00:00
Dan Gohman
04d52f8435 Change variables which are exactly 16 bytes to be 16-byte-aligned too.
This fixes test/Transforms/GlobalOpt/gv-align.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 00:46:07 +00:00
Dan Gohman
c9ae19e465 Make globalopt refine global variable alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 00:14:16 +00:00
Bob Wilson
ec54d6ab84 Check for terminating conditions before adding PHIs to the worklists.
This is more efficient than adding them to the worklist and then ignoring them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 00:10:41 +00:00
Dan Gohman
a4ae3a100d If the bitcode reader input stream isn't a multiple of 4 bytes, it's more
likely not a bitcode file at all, rather than being a bitcode file which
is truncated. Check for this case and issue a more relevant error message.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 00:03:51 +00:00
Bob Wilson
7272b92009 Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 23:06:38 +00:00
Bob Wilson
6f69035970 Rewrite another SSAUpdater function to avoid recursion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 23:05:58 +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
Evan Cheng
3ea97550e3 In 64-bit mode, use i64 to lower memcpy / memset instead of f64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:27:45 +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
42642d06c9 Add comments about DstAlign and SrcAlign.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:10:42 +00:00
Bob Wilson
33f22e8c66 Change another SSAUpdater function to avoid recursion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:04:30 +00:00
Bob Wilson
9bdb8f0717 Simplify the code to check for existing PHIs, now that it is only used in
one place.  This removes the template function added in svn 94690.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 19:53:48 +00:00
Bob Wilson
e8b64281ce The SSAUpdater should avoid recursive traversals of the CFG, since that may
blow out the stack for really big functions.  Start by fixing an easy case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100126 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 18:46:59 +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
Benjamin Kramer
d48c1f9b10 Remove accidental include and add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 14:39:55 +00:00
Benjamin Kramer
6a9cd41549 Various improvements to MemoryBuffer::getFile:
- Use a RAII object to close the FD.
- Use sys::StrError instead of thread-unsafe strerror calls.
- Recover gracefully if read returns zero. This works around an issue on
  DragonFlyBSD where /dev/null has an st_size of 136 but we can't read 136 bytes
  from it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 14:35:22 +00:00
Gabor Greif
c8b82ccbcf Introduce ImmutableCallSite, useful for contexts where no mutation
is necessary. Inherits from new templated baseclass CallSiteBase<>
which is highly customizable. Base CallSite on it too, in a configuration
that allows full mutation.
Adapt some call sites in analyses to employ ImmutableCallSite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 08:21:08 +00:00
Nick Lewycky
2d7820cb78 Clean up this file a little, no functionality change. This is a subset of my
patch back in r94322.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 07:34:00 +00:00
Chris Lattner
a41b9153c3 switch IRBuilder to use NewDebugLoc for locations instead
of raw mdnodes.  This allows frontends to specify debug
locations without ever creating an MDNode for the DILocation.

This requires a corresponding clang/llvm-gcc change which
I'll try to commit as simultaneously as possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 06:31:45 +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
Evan Cheng
48c58bb861 Nehalem unaligned memory access is fast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 05:58:17 +00:00
Chris Lattner
61336ae001 Switch the representation of the location in instruction from
being a TrackingVH<MDNode> to a NewDebugLoc, shrinking 
sizeof(Instruction) a lot, and providing clients the ability
to deal with locations in terms of NewDebugLoc instead of
having to deal with Metadata.  This is still fully compatible
with all clients that *do* use MDNodes for everything of
course.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 05:23:13 +00:00
Chris Lattner
b45218f7c8 include header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 05:20:21 +00:00
Chris Lattner
449c3103c5 rewrite handling of forward ref'd instruction metadata
to used deferred resolution instead of creating a temporary
node + rauw.  There is no reason to create the temporary
mdnode, then do rauw, then destroy it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 05:14:45 +00:00
Chris Lattner
175edf2c78 fix a bug in DebugRecVH::deleted/allUsesReplacedWith. If an
entry in the Scope+InlinedAt drops to a non-canonical form,
we need to reset the idx member of both VH's to 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 05:12:07 +00:00
Chris Lattner
73180c5355 no really, we don't need to copy strings around in the accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 04:53:22 +00:00
Chris Lattner
fe805249f7 eliminate a temporary smallvector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 04:51:13 +00:00
Chris Lattner
68c5513499 add a method to decode a DILocation into a NewDebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 03:55:42 +00:00
Eric Christopher
ec306a9771 Add aeskeygenassist intrinsic and rename all of the aes intrinsics to
aes instead of sse4.2.  Add a brief todo for a subtarget flag and rework
the aeskeygenassist instruction to more closely match the docs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 03:05:45 +00:00
Chris Lattner
4e5f38ec6b update cmakefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 01:02:19 +00:00
Chris Lattner
b227925fa3 Add a new "NewDebugLoc" class which will eventually replace DebugLoc,
and will replace the 'DbgInfo' member in Instruction.

The benefit of NewDebugLoc is that it is compact (8 bytes vs 12/24 
bytes for the DbgInfo member in Instruction on a 32/64 bit system),
it means that we will end up not having to allocate MDNodes to 
represent the "DILocations" in common cases of -O0 -g, and it is
much more efficient to get things out of than the MDNode.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 00:37:44 +00:00
Jim Grosbach
1118b5e490 vml[as] are slow on 1136jf-s also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 00:13:43 +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
Bob Wilson
a0c6057061 Rewrite part of the SSAUpdater to be more careful about inserting redundant
PHIs.  The previous algorithm was unable to reliably detect when existing
PHIs in a cycle can be reused.  I'm still working on reducing a testcase.
Radar 7711900.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 20:51:00 +00:00
Dale Johannesen
536d31b5b3 Fix a nasty dangling-pointer heisenbug that could
generate wrong code pretty much anywhere AFAICT.
A case that hits the bug reproducibly is impossible,
but the situation was like this:
Addr = ...
Store -> Addr
Addr2 = GEP , 0, 0
Store -> Addr2
Handling the first store, the code changed replaced Addr
with a sunkaddr and deleted Addr, but not its table
entry.  Code in OptimizedBlock replaced Addr2 with a
bitcast; if that happened to reuse the memory of Addr,
the old table entry was erroneously found when handling
the second store.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 20:37:15 +00:00
Chris Lattner
563d83ff53 reduce indentation, minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 20:32:51 +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
Jakob Stoklund Olesen
85ffee2c78 Use spaces, not tabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 20:05:12 +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
Bill Wendling
d93bf04a07 Comment the changes for r98218 and friends inside the source code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 18:48:58 +00:00
Bill Wendling
5e1b55d672 Comment the changes for r98218 and friends inside the source code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 18:47:10 +00:00
Jakob Stoklund Olesen
5f282b5dfd Fix PR6750. Don't try to merge a DomainValue with itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 17:13:16 +00:00
Benjamin Kramer
41d43ebac5 s/getNameStr/getName/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 16:06:22 +00:00
Benjamin Kramer
4ef68221a5 Bump SmallString size a bit to avoid malloc trashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 16:04:26 +00:00
Torok Edwin
61633368cf AddSignalHandler was not releasing the critical section on win32.
Patch from Gianluigi Tiesi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 12:07:16 +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
7a2f3e0b46 microoptimize this hot method, also making it more
consistent with other similar ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:53:47 +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