Evan Cheng
619f1b8a94
Coalescer should not delete copy instructions whose defs are partially dead. e.g.
...
%RDI<def,dead> = MOV64rr %RAX<kill>, %EDI<imp-def>
llvm-svn: 100804
2010-04-08 20:02:37 +00:00
Ted Kremenek
141d32b7e9
Fix -Wsign-compare warning (issued by clang++).
...
llvm-svn: 100799
2010-04-08 18:49:30 +00:00
Devang Patel
17b5b1dd88
Rename a function.
...
llvm-svn: 100797
2010-04-08 18:43:56 +00:00
Chris Lattner
f6e9c0c4bd
implicit defs get added to the end of machine instrs sometimes. Scan the whole instruction for the metadata operand instead of assuming it will be at the end of the instruction.
...
llvm-svn: 100792
2010-04-08 18:20:52 +00:00
Devang Patel
89756fdbfc
One instruction may start (or end) multiple lexical scopes.
...
There is no need to remember labels identifying regions marked by such instructions in each scope.
llvm-svn: 100781
2010-04-08 16:50:29 +00:00
Devang Patel
3cc4a24666
Remove dead code.
...
llvm-svn: 100771
2010-04-08 15:48:02 +00:00
Devang Patel
b9f9a00513
Delete out of date comment.
...
llvm-svn: 100769
2010-04-08 15:41:13 +00:00
Devang Patel
9ada7b28a2
Refactor.
...
llvm-svn: 100768
2010-04-08 15:37:09 +00:00
Benjamin Kramer
0fb23008bb
Use twines to simplify calls to report_fatal_error. For code size and readability.
...
llvm-svn: 100756
2010-04-08 10:44:28 +00:00
Evan Cheng
3fa0b6fb03
Avoid using f64 to lower memcpy from constant string. It's cheaper to use i32 store of immediates.
...
llvm-svn: 100751
2010-04-08 07:37:57 +00:00
Evan Cheng
2f7cee1730
Make post regalloc machine licm functional. It now passes all of MultiSource.
...
llvm-svn: 100742
2010-04-08 01:03:47 +00:00
Chris Lattner
579e7eb423
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!
llvm-svn: 100731
2010-04-08 00:09:16 +00:00
Chris Lattner
f9fbc74e40
minor tidying.
...
llvm-svn: 100725
2010-04-07 23:50:38 +00:00
Chris Lattner
96ed85d7ab
use assertions instead of unreachable for logic errors.
...
llvm-svn: 100724
2010-04-07 23:47:51 +00:00
Chris Lattner
393ea6fc22
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 :)
llvm-svn: 100723
2010-04-07 23:40:44 +00:00
Chris Lattner
80b41881bc
rename llvm::llvm_report_error -> llvm::report_fatal_error
...
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Chris Lattner
0768c834fe
remove some unneeded errorhandling stuff.
...
llvm-svn: 100703
2010-04-07 22:44:07 +00:00
Chris Lattner
cc827ee016
tidy up
...
llvm-svn: 100700
2010-04-07 22:29:10 +00:00
Anton Korobeynikov
e5c1563130
Remove late ARM codegen optimization pass committed by accident.
...
It is not ready for public yet.
llvm-svn: 100673
2010-04-07 18:23:27 +00:00
Anton Korobeynikov
f93145e685
Initial support for different kinds of FU reservation.
...
llvm-svn: 100645
2010-04-07 18:19:32 +00:00
Anton Korobeynikov
bf7bbe3e94
Factor out scoreboard into separate class. This way we might have several different score boards.
...
llvm-svn: 100644
2010-04-07 18:19:24 +00:00
Anton Korobeynikov
d873a16430
Add hook to insert late LLVM=>LLVM passes just before isel
...
llvm-svn: 100640
2010-04-07 18:18:42 +00:00
Chris Lattner
f520500a06
fix 80 col violation, patch by Alastair Lynn
...
llvm-svn: 100639
2010-04-07 18:13:33 +00:00
Chris Lattner
7816ae8fd0
add a comment line that got dropped
...
llvm-svn: 100638
2010-04-07 18:10:38 +00:00
Chris Lattner
60e5f55565
fix a latent bug my inline asm stuff exposed:
...
MachineOperand::isIdenticalTo wasn't handling metadata operands.
llvm-svn: 100636
2010-04-07 18:03:19 +00:00
Benjamin Kramer
389c863692
Remove unused method.
...
llvm-svn: 100620
2010-04-07 11:23:46 +00:00
Torok Edwin
9028487b8b
Workaround the breakage in r100616 by guarding all timers with
...
TimePassesIsEnabled. This should allow make check to pass.
llvm-svn: 100618
2010-04-07 10:44:46 +00:00
Bill Wendling
8282504a14
Use the "NamedGroupTimer" class to categorize DWARF emission better.
...
llvm-svn: 100616
2010-04-07 09:28:04 +00:00
Benjamin Kramer
663f265996
Use raw_ostream.
...
llvm-svn: 100615
2010-04-07 09:26:51 +00:00
Evan Cheng
0f71b51991
Add comments for missed opportunities.
...
llvm-svn: 100610
2010-04-07 06:00:33 +00:00
Evan Cheng
eb32efa3b6
Fix typo.
...
llvm-svn: 100609
2010-04-07 05:59:12 +00:00
Chris Lattner
122572e13a
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.
llvm-svn: 100607
2010-04-07 05:38:05 +00:00
Chris Lattner
2bf164dbf2
remove another magic number.
...
llvm-svn: 100606
2010-04-07 05:27:36 +00:00
Chris Lattner
dde7376e9d
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.
llvm-svn: 100605
2010-04-07 05:20:54 +00:00
Dale Johannesen
c0f9c29448
Move printing of target-indepedent DEBUG_VALUE comments
...
into AsmPrinter. Target-dependent form is still generated
by FastISel and still handled in X86 code.
llvm-svn: 100596
2010-04-07 01:15:14 +00:00
Evan Cheng
ac90d47ea3
Post regalloc LICM. Work in progress.
...
llvm-svn: 100592
2010-04-07 00:41:17 +00:00
Devang Patel
bcab88162a
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.
...
llvm-svn: 100586
2010-04-06 23:53:48 +00:00
John McCall
e20cc3b28c
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.
llvm-svn: 100581
2010-04-06 23:35:53 +00:00
Dale Johannesen
2a51b8abe5
Revert 100573, it's causing some testsuite problems.
...
llvm-svn: 100578
2010-04-06 22:45:26 +00:00
Dale Johannesen
fefeacda3b
Move printing of DEBUG_VALUE comments to target-independent place.
...
There is probably a more elegant way to do this.
llvm-svn: 100573
2010-04-06 22:21:07 +00:00
Dale Johannesen
fef6eb4076
Allow for the possibility that a debug-value points
...
to a SDNode that didn't have code generated for it.
llvm-svn: 100566
2010-04-06 21:59:56 +00:00
Stuart Hastings
4f6cdc07e9
Reverting 100530 & 100531 due to regressions in the GDB test suite.
...
llvm-svn: 100563
2010-04-06 21:38:29 +00:00
Evan Cheng
99617bac24
Code clean up. Move includes from VirtRegRewriter.h to VirtRegRewriter.cpp.
...
llvm-svn: 100532
2010-04-06 17:19:55 +00:00
Stuart Hastings
749cf45929
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.
llvm-svn: 100530
2010-04-06 17:19:32 +00:00
Mon P Wang
c0da8af5c3
Remove assert to treat memmove and memset like memcpy
...
llvm-svn: 100521
2010-04-06 08:27:51 +00:00
Chris Lattner
960095d2c8
propagate cookie management out one layer of function calls.
...
llvm-svn: 100510
2010-04-06 00:58:50 +00:00
Chris Lattner
344a742ed1
report errors through LLVMContext's inline asm handler if available.
...
llvm-svn: 100509
2010-04-06 00:55:39 +00:00
Chris Lattner
8c1f45d90b
Give MachineModuleInfo an actual Module*.
...
llvm-svn: 100508
2010-04-06 00:51:52 +00:00
Devang Patel
5e0cb53223
Remove unnecessary include.
...
llvm-svn: 100505
2010-04-06 00:38:32 +00:00
Evan Cheng
c6dc63d62c
Fix an obvious copy-n-paste bug. It's not known to cause any miscompilation.
...
llvm-svn: 100494
2010-04-05 23:33:29 +00:00
Chris Lattner
f753452587
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
llvm-svn: 100492
2010-04-05 23:15:42 +00:00
Chris Lattner
5b4c7591ac
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!
llvm-svn: 100491
2010-04-05 23:11:24 +00:00
Bill Wendling
bf50ddf6ac
Output floating point representations in DWARF format. This is done by outputing
...
the FP encoding directly as a hex representation.
llvm-svn: 100487
2010-04-05 22:59:21 +00:00
Chris Lattner
269737461d
stringref-ize the MemoryBuffer::get apis. This requires
...
a co-committed clang patch.
llvm-svn: 100485
2010-04-05 22:42:30 +00:00
Dan Gohman
302746a632
Add a comment.
...
llvm-svn: 100459
2010-04-05 20:24:08 +00:00
Chris Lattner
7d609ea6cb
lowering a volatile llvm.memcpy to a libc memcpy is ok.
...
PR6779
llvm-svn: 100457
2010-04-05 20:11:45 +00:00
Dan Gohman
2aff0055c1
Don't do code sinking on unreachable blocks. It's unprofitable and hazardous.
...
llvm-svn: 100455
2010-04-05 19:17:22 +00:00
Chris Lattner
aa58ed7c00
remove the now-redundant MMI pointer in SelectionDAG.
...
llvm-svn: 100419
2010-04-05 06:19:28 +00:00
Chris Lattner
91309715b4
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
llvm-svn: 100418
2010-04-05 06:12:01 +00:00
Chris Lattner
097a332684
remove some redundant MMI arguments.
...
llvm-svn: 100417
2010-04-05 06:10:13 +00:00
Chris Lattner
6f3c3f60ce
unthread MMI from FastISel
...
llvm-svn: 100416
2010-04-05 06:05:26 +00:00
Chris Lattner
cfca39ef59
remove the MMI pointer from MachineFrameInfo.
...
llvm-svn: 100415
2010-04-05 05:57:52 +00:00
Chris Lattner
811d538611
enhance MachineFunction to have a MMI pointer.
...
llvm-svn: 100414
2010-04-05 05:49:50 +00:00
Chris Lattner
341747c032
privatize more stuff, eliminate vtables.
...
llvm-svn: 100410
2010-04-05 05:32:45 +00:00
Chris Lattner
5d96bd2bbe
reprivatize now that DwarfWriter is gone.
...
llvm-svn: 100409
2010-04-05 05:31:04 +00:00
Chris Lattner
59156acba1
prune #includes, MMI can never be null
...
llvm-svn: 100408
2010-04-05 05:28:23 +00:00
Chris Lattner
f2fb401571
prune #includes, realize the MMI can never be null.
...
llvm-svn: 100407
2010-04-05 05:24:55 +00:00
Chris Lattner
37d4f1e56e
finally blast DwarfWriter away.
...
llvm-svn: 100406
2010-04-05 05:12:59 +00:00
Chris Lattner
df6b0827aa
change AsmPrinter to use DwarfDebug/DwarfException directly
...
instead of going through DwarfWriter.
llvm-svn: 100405
2010-04-05 05:11:15 +00:00
Chris Lattner
248e65ec05
trim some spurious references to DwarfWriter. SDIsel really doesn't
...
need it anymore, so don't addRequire it.
llvm-svn: 100400
2010-04-05 04:09:20 +00:00
Chris Lattner
16ed3bfb2b
eliminate DwarfDebug::shouldEmit, which is the same now as MMI::hasDebugInfo
...
llvm-svn: 100386
2010-04-05 03:52:55 +00:00
Chris Lattner
697c2edddc
fix a regression on 2009-08-17-DebugInfo.m
...
llvm-svn: 100385
2010-04-05 03:49:26 +00:00
Chris Lattner
c930f73b4d
selection dag doesn't need DwarfWriter, remove some tendrils.
...
llvm-svn: 100382
2010-04-05 02:23:33 +00:00
Chris Lattner
1fda8b3a8b
fastisel doesn't need DwarfWriter, remove some tendricles.
...
llvm-svn: 100381
2010-04-05 02:19:28 +00:00
Chris Lattner
6040137045
just have all targets create the DwarfWriter.
...
llvm-svn: 100377
2010-04-05 00:42:55 +00:00
Chris Lattner
fd80e7cca8
nuke DwarfPrinter
...
llvm-svn: 100375
2010-04-05 00:27:29 +00:00
Chris Lattner
122288eb97
make DwarfException not inherit from DwarfPrinter.
...
llvm-svn: 100374
2010-04-05 00:26:50 +00:00
Chris Lattner
c1b63a2dfa
change SizeOf to take AsmPrinter instead of TargetData,
...
simplifying a bunch of code.
llvm-svn: 100373
2010-04-05 00:18:22 +00:00
Chris Lattner
2b89b0d279
1) make DIE take AsmPrinter instead of DwarfPrinter.
...
2) change DwarfDebug to not inherit from DwarfPrinter.
llvm-svn: 100372
2010-04-05 00:13:49 +00:00
Chris Lattner
0744c47856
Move EmitFrameMoves into AsmPrinter.
...
llvm-svn: 100371
2010-04-04 23:41:46 +00:00
Chris Lattner
303e9e2e0a
simplify code and reduce indentation.
...
llvm-svn: 100369
2010-04-04 23:31:58 +00:00
Chris Lattner
2eaed62f7c
now that the magic is dispelled, move EmitSectionOffset to AsmPrinter.
...
llvm-svn: 100368
2010-04-04 23:25:33 +00:00
Chris Lattner
ecdad4bb0c
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.
llvm-svn: 100367
2010-04-04 23:22:29 +00:00
Chris Lattner
957eddbcb0
only emit section labels if we have debug info, fixing a few
...
regtest failures.
llvm-svn: 100366
2010-04-04 23:17:54 +00:00
Chris Lattner
7295a273aa
I was wrong, ocaml isn't referencing 'Ldata_begin', so remove it.
...
llvm-svn: 100365
2010-04-04 23:10:38 +00:00
Chris Lattner
4bd354ecd8
add some assertions to EmitSectionOffset.
...
llvm-svn: 100364
2010-04-04 23:06:31 +00:00
Chris Lattner
a991a67a29
stop emitting some dead L labels.
...
llvm-svn: 100363
2010-04-04 23:02:02 +00:00
Chris Lattner
265b59119d
Store an use the symbols emitted at the start of the debug
...
sections instead of magically rematerializing them later.
llvm-svn: 100362
2010-04-04 22:59:04 +00:00
Chris Lattner
53453a2dc8
remove the didInitial ivar, rename emitInitial to be more
...
descriptive, change EmitSectionOffset back to taking a
symbol instead of a string.
llvm-svn: 100361
2010-04-04 22:33:59 +00:00
Chris Lattner
df18fb3a6d
simplify EmitSectionOffset a little bit, improve comments.
...
llvm-svn: 100360
2010-04-04 22:25:14 +00:00
Chris Lattner
168d49e6cd
The "IsSmall" argument to EmitSectionOffset is always true,
...
constant fold it away.
llvm-svn: 100356
2010-04-04 21:34:40 +00:00
Chris Lattner
da4fe3e7d2
eliminate the "isEH" argument to EmitSectionOffset.
...
llvm-svn: 100355
2010-04-04 21:31:54 +00:00
Chris Lattner
2f1c065cef
isAbsoluteEHSectionOffsets always returns false, eliminate it
...
and substitute false at the one call site.
llvm-svn: 100354
2010-04-04 21:29:44 +00:00
Chris Lattner
c83be77854
move some more stuff to asmprinter.
...
llvm-svn: 100351
2010-04-04 20:20:50 +00:00
Chris Lattner
7214d4d564
simplify some code.
...
llvm-svn: 100350
2010-04-04 20:10:41 +00:00
Chris Lattner
703ccb1b4c
move EmitEncodingByte to AsmPrinter.
...
llvm-svn: 100349
2010-04-04 20:04:21 +00:00
Chris Lattner
071eb40cd2
move EmitCFAByte to AsmPrinter.
...
llvm-svn: 100348
2010-04-04 20:01:25 +00:00
Chris Lattner
24ed58efd1
inline EmitDifference away.
...
llvm-svn: 100347
2010-04-04 19:58:12 +00:00
Chris Lattner
779e051357
resolve a fixme.
...
llvm-svn: 100346
2010-04-04 19:28:59 +00:00
Chris Lattner
c2b0a02be0
move gettemplabel and getdwlabel to AsmPrinter and rename
...
them for consistency.
llvm-svn: 100345
2010-04-04 19:25:43 +00:00