Commit Graph

9525 Commits

Author SHA1 Message Date
Devang Patel
50d80e394d Do not include types without any definition in pubtypes list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:35:04 +00:00
Evan Cheng
c15d9135a8 Avoid variable shadowing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:25:29 +00:00
Evan Cheng
aeb2f4aa46 Expand postra machine licm's capability a little more. If an instruction's register operands are all loop invariants, then it's safe to hoist it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:21:05 +00:00
Jakob Stoklund Olesen
8d17160e2c Teach MachineSinking to handle easy critical edges.
Sometimes it is desirable to sink instructions along a critical edge:

x = ...
if (a && b) ...
else use(x);

The 'a && b' condition creates a critical edge to the else block, but we still
want to sink the computation of x into the block. The else block is dominated by
the parent block, so we are not pushing instructions into new code paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 19:06:14 +00:00
Evan Cheng
5dc57ce533 Teach postra machine licm to hoist more obvious invariants, e.g. instructions with no source operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 18:16:00 +00:00
Dan Gohman
4183e31978 Add a few comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 17:07:06 +00:00
Dan Gohman
81bf03eb5c Eliminate MachineBasicBlock::const_livein_iterator and make
MachineBasicBlock::livein_iterator a const_iterator, because
clients shouldn't ever be using the iterator interface to
mutate the livein set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:57:55 +00:00
Dan Gohman
9e9aa44d1a Rename MachineFrameInfo variables to MFI, for consistency with
the rest of CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:56:45 +00:00
Dan Gohman
13e73f483e Move MachineRegisterInfo's isLiveIn and isLiveOut out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:55:37 +00:00
Dan Gohman
5c982949bf Delete an unused member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:51:39 +00:00
Chris Lattner
43ac721e3b add llvm codegen support for -ffunction-sections and -fdata-sections,
patch by Sylvere Teissier!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 00:36:43 +00:00
Dan Gohman
8b3d6682a4 Remove a #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 16:26:03 +00:00
Benjamin Kramer
678d9b7ed0 Plug trivial leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 11:38:35 +00:00
Evan Cheng
09010a30fd Enable post regalloc machine licm by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 06:25:28 +00:00
Dan Gohman
58c2587ed8 Remove unnecessary parens.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 02:24:01 +00:00
Bob Wilson
347fa3fa26 Tidy whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 21:38:26 +00:00
Devang Patel
5142471fcd Clear InsnsBeginScopeSet and InsnsEndScopeSet at the end of function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 16:04:20 +00:00
Dan Gohman
7d597b4428 Delete this obsolete comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 14:12:01 +00:00
Chandler Carruth
7b0138ffab Add a missing dependency to this library when building with CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 05:55:25 +00:00
Bob Wilson
1793ab9e70 Use getNumImplicitDefs() and getNumImplicitUses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 04:46:43 +00:00
Bob Wilson
0855cadb00 Fix up some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 04:34:03 +00:00
Dan Gohman
e056781323 Add variants of ult, ule, etc. which take a uint64_t RHS, for convenience.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100824 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 23:03:40 +00:00
Chris Lattner
287df1bc03 delete a forwarding function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 21:34:17 +00:00
Chris Lattner
74aae4726a move elf section uniquing to MCContext. Along the way
merge XCore's section into MCSectionELF


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 21:26:26 +00:00
Chris Lattner
22772214de remove the TargetLoweringObjectFileMachO::getMachoSection
api and update clients to use MCContext instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100808 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 20:40:11 +00:00
Chris Lattner
f0559e4b24 move macho section uniquing from MCParser and TLOF to MCContext where
the compiler and asmparser now unique to the same sections.  This fixes
rdar://7835021.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 20:30:37 +00:00
Evan Cheng
a57fabe815 Coalescer should not delete copy instructions whose defs are partially dead. e.g.
%RDI<def,dead> = MOV64rr %RAX<kill>, %EDI<imp-def>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 20:02:37 +00:00
Ted Kremenek
d0e88f3596 Fix -Wsign-compare warning (issued by clang++).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 18:49:30 +00:00
Devang Patel
e37b0c6c25 Rename a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 18:43:56 +00:00
Chris Lattner
d0024fec25 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 18:20:52 +00:00
Devang Patel
1c246358a0 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 16:50:29 +00:00
Devang Patel
6a5975f49f Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 15:48:02 +00:00
Devang Patel
6669b81203 Delete out of date comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100769 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 15:41:13 +00:00
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