1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

9300 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes
d5eafae1fd Add support to properly reference private symbols on relocation entries.
Use proper relocation type to build relocations for JumpTables (rodata
sections).

llvm-svn: 76326
2009-07-18 19:30:09 +00:00
Nick Lewycky
ec10fcbd04 Replace intersectWith with maximalIntersectWith. The latter guarantees that
all values belonging to the intersection will belong to the resulting range.
The former was inconsistent about that point (either way is fine, just pick
one.) This is part of PR4545.

llvm-svn: 76289
2009-07-18 06:34:42 +00:00
Evan Cheng
84f06f0ee6 Enable cross register class coalescing.
llvm-svn: 76281
2009-07-18 02:10:10 +00:00
Evan Cheng
fe529a2c29 Revert 76177 for now. It's messing up ARM asm printing. Also this significant debate about its efficiency.
llvm-svn: 76279
2009-07-18 01:43:53 +00:00
Reid Kleckner
5460ad390c Add EngineBuilder to ExecutionEngine in favor of the five optional argument EE::create().
Also a test commit.

llvm-svn: 76276
2009-07-18 00:42:18 +00:00
Dan Gohman
e45061eefe Convert more code to use Operator instead of explicitly handling both
ConstantExpr and Instruction. This involves duplicating some code
between GetElementPtrInst and GEPOperator, but it's not a lot.

llvm-svn: 76265
2009-07-17 23:55:56 +00:00
Daniel Dunbar
ec0fd7ebe5 Add llvm::InitializeAllTargetInfos and llvm::InitializeAllAsmParsers.
llvm-svn: 76253
2009-07-17 22:35:35 +00:00
Chris Lattner
7cf9653432 remove AsmPrinter::findGlobalValue, just use Value::stripPointerCasts instead.
llvm-svn: 76246
2009-07-17 22:00:23 +00:00
Dan Gohman
c639ee66f0 Add a GEPOperator class, and move the hasNoPointerOverflow
accessors into it.

llvm-svn: 76245
2009-07-17 21:33:58 +00:00
Dan Gohman
b8ff7ff3cc Commit this change, to accompany r76232.
llvm-svn: 76238
2009-07-17 21:03:54 +00:00
Dan Gohman
25a722cc45 Add a new Operator class, for handling Instructions and ConstantExprs
in a convenient manner, factoring out some common code from
InstructionCombining and ValueTracking. Move the contents of
BinaryOperators.h into Operator.h and use Operator to generalize them
to support ConstantExprs as well as Instructions.

llvm-svn: 76232
2009-07-17 20:47:02 +00:00
Chris Lattner
ffe0c407be Untangle a snarl that I discovered when updating the mangler,
starting in getCurrentFunctionEHName.  Among other problems,
we would try to privative a "foo.eh" label, but end up emitting
the label as _Lfoo.eh instead of L_foo.eh on darwin.  This is really
bad, and the linker has always tolerated these labels existing.
For now, just emit them as _foo.eh.

This patch also fixes problems with ".eh" labels on unnamed
functions and eliminates two strangely defined TargetAsmInfo
hooks.

llvm-svn: 76231
2009-07-17 20:46:40 +00:00
Daniel Dunbar
de011196a4 Sketch support for target specific assembly parser.
- Not fully enabled yet, need a configure regeneration.

llvm-svn: 76230
2009-07-17 20:42:00 +00:00
Mikhail Glushenkov
d44eba5166 Trailing whitespace.
llvm-svn: 76229
2009-07-17 20:38:17 +00:00
Xerxes Ranby
d90b36055d Implement cmake LLVM_MULTITHREADED gcc atomic builtin checks.
llvm-svn: 76221
2009-07-17 19:22:41 +00:00
Dan Gohman
006b15b943 Define a no-pointer-overflow flag for GetElementPtr instructions.
llvm-svn: 76218
2009-07-17 19:01:15 +00:00
Dan Gohman
9a36c67769 Add new classes for working with optional optimization data
for binary operators Add, Sub, Mul, and UDiv.

llvm-svn: 76217
2009-07-17 18:59:51 +00:00
Anton Korobeynikov
e0aa2053d5 Fix copy & paste errors
llvm-svn: 76216
2009-07-17 18:57:16 +00:00
Dan Gohman
3a0e58549b Add a method to clear optional optimization information from a Value.
llvm-svn: 76215
2009-07-17 18:56:23 +00:00
Anton Korobeynikov
59a1adb87c Add missed attributes to C bindings
llvm-svn: 76214
2009-07-17 18:55:30 +00:00
Anton Korobeynikov
60f7bd3562 Add support for naked functions
llvm-svn: 76198
2009-07-17 18:07:26 +00:00
Dan Gohman
67f2b7d376 Add a SubclassOptionalData field to Value. See the doxygen comment for
details.

llvm-svn: 76189
2009-07-17 17:16:59 +00:00
Dan Gohman
e2276d0168 Fix an apparent typo.
llvm-svn: 76183
2009-07-17 16:12:36 +00:00
David Greene
ba889e5a71 Make DOUT an lvalue in release mode so that developers may use DOUT in
their code in release mode.  This helps to debug release-mode problems.

llvm-svn: 76182
2009-07-17 15:55:53 +00:00
David Greene
70e8a51127 Add logic to align instruction operands to columns for pretty-printing.
No target uses this currently.  This patch only adds the mechanism so
that local installations can choose to enable this.

llvm-svn: 76177
2009-07-17 14:24:46 +00:00
Eli Friedman
ff61032fa0 Documentation clarifications for isSafeToSpeculativelyExecute.
llvm-svn: 76168
2009-07-17 08:38:29 +00:00
Eli Friedman
b56b3ca224 Replace isTrapping with a new, similar method called
isSafeToSpeculativelyExecute. The new method is a bit closer to what 
the callers actually care about in that it rejects more things callers 
don't want.  It also adds more precise handling for integer 
division, and unifies code for analyzing the legality of a speculative 
load.

llvm-svn: 76150
2009-07-17 04:28:42 +00:00
Owen Anderson
1c2b8cc518 Privatize the MDNode uniquing table.
llvm-svn: 76126
2009-07-16 23:44:30 +00:00
Owen Anderson
476adb2e49 Privatize the MDString uniquing table.
llvm-svn: 76113
2009-07-16 22:11:26 +00:00
Daniel Dunbar
276e4a7a7d Add raw_null_ostream and llvm::nulls(), a raw_ostream that discards output.
- No functionality change.

llvm-svn: 76103
2009-07-16 21:17:53 +00:00
Jeffrey Yasskin
a4b7ea7485 Add line numbers to OProfile. To do this, I added a processDebugLoc()
call to the MachineCodeEmitter interface and made copying the start
line of a function not conditional on whether we're emitting Dwarf
debug information. I'll propagate the processDebugLoc() calls to the
non-X86 targets in a followup patch.

In the long run, it'll probably be better to gather this information
through the DwarfWriter, but the DwarfWriter currently depends on the
AsmPrinter and TargetAsmInfo, and fixing that would be out of the way
for this patch.

There's a bug in OProfile 0.9.4 that makes it ignore line numbers for
addresses above 4G, and a patch fixing it at
http://thread.gmane.org/gmane.linux.oprofile/7634

Sample output:

$ sudo opcontrol --reset; sudo opcontrol --start-daemon; sudo opcontrol --start; `pwd`/Debug/bin/lli fib.bc; sudo opcontrol --stop
Signalling daemon... done
Profiler running.
fib(40) == 165580141
Stopping profiling.

$ opreport -g -d -l `pwd`/Debug/bin/lli|head -60
Overflow stats not available
CPU: Core 2, speed 1998 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
vma      samples  %        linenr info                 image name               symbol name
00007f67a30370b0 25489    61.2554  fib.c:24                    10946.jo                 fib_left
  00007f67a30370b0 1634      6.4106  fib.c:24
  00007f67a30370b1 83        0.3256  fib.c:24
  00007f67a30370b9 1997      7.8348  fib.c:24
  00007f67a30370c6 2080      8.1604  fib.c:27
  00007f67a30370c8 988       3.8762  fib.c:27
  00007f67a30370cd 1315      5.1591  fib.c:27
  00007f67a30370cf 251       0.9847  fib.c:27
  00007f67a30370d3 1191      4.6726  fib.c:27
  00007f67a30370d6 975       3.8252  fib.c:27
  00007f67a30370db 1010      3.9625  fib.c:27
  00007f67a30370dd 242       0.9494  fib.c:27
  00007f67a30370e1 2782     10.9145  fib.c:28
  00007f67a30370e5 3768     14.7828  fib.c:28
  00007f67a30370eb 615       2.4128  (no location information)
  00007f67a30370f3 6558     25.7287  (no location information)
00007f67a3037100 15603    37.4973  fib.c:29                    10946.jo                 fib_right
  00007f67a3037100 1646     10.5493  fib.c:29
  00007f67a3037101 45        0.2884  fib.c:29
  00007f67a3037109 2372     15.2022  fib.c:29
  00007f67a3037116 2234     14.3178  fib.c:32
  00007f67a3037118 612       3.9223  fib.c:32
  00007f67a303711d 622       3.9864  fib.c:32
  00007f67a303711f 385       2.4675  fib.c:32
  00007f67a3037123 404       2.5892  fib.c:32
  00007f67a3037126 634       4.0633  fib.c:32
  00007f67a303712b 870       5.5759  fib.c:32
  00007f67a303712d 62        0.3974  fib.c:32
  00007f67a3037131 1848     11.8439  fib.c:33
  00007f67a3037135 2840     18.2016  fib.c:33
  00007f67a303713a 1         0.0064  fib.c:33
  00007f67a303713b 1023      6.5564  (no location information)
  00007f67a3037143 5         0.0320  (no location information)
000000000080c1e4 15        0.0360  MachineOperand.h:150        lli                      llvm::MachineOperand::isReg() const
  000000000080c1e4 6        40.0000  MachineOperand.h:150
  000000000080c1ec 2        13.3333  MachineOperand.h:150
...

llvm-svn: 76102
2009-07-16 21:07:26 +00:00
Owen Anderson
c63b0e7a30 Privatize the ConstantFP table. I'm on a roll!
llvm-svn: 76097
2009-07-16 19:05:41 +00:00
Owen Anderson
21d2d69727 Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here

llvm-svn: 76089
2009-07-16 18:04:31 +00:00
Kevin Enderby
f641ecc6e8 Removed the SubsectionsViaSymbols MCStreamer API and replaced it with a generic
EmitAssemblerFlag API which takes a value from the added AssemblerFlag
enumerated constants.

llvm-svn: 76087
2009-07-16 17:56:39 +00:00
Dan Gohman
69d03cf2ee Add an isLoopSimplifyForm() predicate, following the example of
isLCSSAForm(), to test whether a loop is in the form guaranteed
by the LoopSimplify pass.

llvm-svn: 76077
2009-07-16 16:16:23 +00:00
Dan Gohman
a5941105f6 Use setStream infomatted_raw_ostream's constructor, to reduce code
duplication. Also, make setStream honor the old DeleteStream flag.

llvm-svn: 76075
2009-07-16 15:37:26 +00:00
Dan Gohman
0fc5c444ff Remove inapplicable comments.
llvm-svn: 76074
2009-07-16 15:33:48 +00:00
Dan Gohman
69066d354c Add explicit keywords.
llvm-svn: 76073
2009-07-16 15:33:04 +00:00
Dan Gohman
6bd1a7fe5e Tidy up #includes.
llvm-svn: 76072
2009-07-16 15:32:28 +00:00
Dan Gohman
0bcfcaa96c Use size_t.
llvm-svn: 76069
2009-07-16 15:24:40 +00:00
Evan Cheng
7a6b20df7f Let callers decide the sub-register index on the def operand of rematerialized instructions.
Avoid remat'ing instructions whose def have sub-register indices for now. It's just really really hard to get all the cases right.

llvm-svn: 75900
2009-07-16 09:20:10 +00:00
Chris Lattner
a9fcfe3d18 add a knob to turn off PrettyStackTrace globally. Patch by Zoltan
Varga!

llvm-svn: 75897
2009-07-16 06:17:45 +00:00
Chris Lattner
4939bd13ad implement .include in the lexer/parser instead of passing it into the streamer.
llvm-svn: 75896
2009-07-16 06:14:39 +00:00
Daniel Dunbar
e83e53b46f Kill off last uses of TargetMachineRegistry class.
llvm-svn: 75892
2009-07-16 02:41:19 +00:00
Daniel Dunbar
88881650c6 Fix gcc 4.0 build failure, can't rely on access inside nested friended class.
llvm-svn: 75891
2009-07-16 02:38:28 +00:00
Daniel Dunbar
a567c0f537 Switch llc and createJIT to use simpler command line parsing for -march.
llvm-svn: 75890
2009-07-16 02:23:53 +00:00
Daniel Dunbar
ffc135d4d5 Add registered target list to --version output.
llvm-svn: 75889
2009-07-16 02:06:09 +00:00
Dan Gohman
9b099cf51b formatted_raw_ostream both is-a raw_ostream and has-a raw_ostream. This
means that two separate raw_ostreams are doing buffering before data is
sent to the underlying stream. Besides the inefficiency of redundant
buffering, the second level of buffering doesn't recieve flush()
requests.

Fix this by having formatted_raw_ostream set the underlying raw_ostream
to be unbuffered. This eliminates inefficiency due to redundant buffering,
and it makes the flush() disconnect harmless.

This fixes PR4559.

llvm-svn: 75883
2009-07-16 01:32:46 +00:00
Daniel Dunbar
4ff7d8f6c9 Add explicit comment that clients can call target initialization functions
multiple times.

llvm-svn: 75880
2009-07-16 01:13:00 +00:00
Owen Anderson
4483fbda5e Revert yesterday's change by removing the LLVMContext parameter to AllocaInst and MallocInst.
llvm-svn: 75863
2009-07-15 23:53:25 +00:00
Daniel Dunbar
4771afe104 Lift addAssemblyEmitter into LLVMTargetMachine.
- No functionality change.

llvm-svn: 75859
2009-07-15 23:34:19 +00:00
Dan Gohman
f01e53a482 Change raw_ostream so that it doesn't call llvm_report_error
immediately on every output error. Instead, add a flag to
raw_ostream, and set the flag whenever an error is detected.

The flag can be queried and cleared from the public API. This
gives applications more flexibility to handling errors in
application-specific ways.

If the flag is not cleared when the raw_ostream is destructed,
llvm_report_error is called from the destructor. This ensures
that errors are not implicitly silenced, and provides
convenient default behavior for tools like llc and opt.
Clients wishing to avoid llvm_report_error calls from
raw_ostream should check for errors and clear the error flag.

llvm-svn: 75857
2009-07-15 23:25:33 +00:00
Owen Anderson
22961edd91 Add an LLVMContext to Type, hardwired to the global context until Type uniquing is moved on the contexts themselves.
llvm-svn: 75853
2009-07-15 22:50:23 +00:00
Bob Wilson
fb88d3e6d9 Clean up some comments.
llvm-svn: 75851
2009-07-15 22:43:51 +00:00
Daniel Dunbar
d85e8b6334 Lift DumpAsm / -print-emitted-asm functionality into LLVMTargetMachine.
- No intended functionality change.

llvm-svn: 75848
2009-07-15 22:33:19 +00:00
Chris Lattner
c1f620597b Update the C bindings to keep the LLVMTypeKind up to date between the C/C++
stuff.  Patch by Zoltan Varga!

llvm-svn: 75842
2009-07-15 22:00:31 +00:00
Daniel Dunbar
2554dd4f1e Remove mismatched and unnecessary declaration.
llvm-svn: 75841
2009-07-15 21:52:40 +00:00
Owen Anderson
13080d27c5 Move a few more convenience factory functions from Constant to LLVMContext.
llvm-svn: 75840
2009-07-15 21:51:10 +00:00
Owen Anderson
0171f6bc65 Move the ConstantStruct factory methods over to LLVMContext.
llvm-svn: 75830
2009-07-15 21:00:46 +00:00
Daniel Dunbar
5707dd7f73 Reapply TargetRegistry refactoring commits.
--- Reverse-merging r75799 into '.':
 U   test/Analysis/PointerTracking
U    include/llvm/Target/TargetMachineRegistry.h
U    include/llvm/Target/TargetMachine.h
U    include/llvm/Target/TargetRegistry.h
U    include/llvm/Target/TargetSelect.h
U    tools/lto/LTOCodeGenerator.cpp
U    tools/lto/LTOModule.cpp
U    tools/llc/llc.cpp
U    lib/Target/PowerPC/PPCTargetMachine.h
U    lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
U    lib/Target/PowerPC/PPCTargetMachine.cpp
U    lib/Target/PowerPC/PPC.h
U    lib/Target/ARM/ARMTargetMachine.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/ARMTargetMachine.h
U    lib/Target/ARM/ARM.h
U    lib/Target/XCore/XCoreTargetMachine.cpp
U    lib/Target/XCore/XCoreTargetMachine.h
U    lib/Target/PIC16/PIC16TargetMachine.cpp
U    lib/Target/PIC16/PIC16TargetMachine.h
U    lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
U    lib/Target/Alpha/AlphaTargetMachine.cpp
U    lib/Target/Alpha/AlphaTargetMachine.h
U    lib/Target/X86/X86TargetMachine.h
U    lib/Target/X86/X86.h
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
U    lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
U    lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
U    lib/Target/X86/X86TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.h
U    lib/Target/CppBackend/CPPTargetMachine.h
U    lib/Target/CppBackend/CPPBackend.cpp
U    lib/Target/CBackend/CTargetMachine.h
U    lib/Target/CBackend/CBackend.cpp
U    lib/Target/TargetMachine.cpp
U    lib/Target/IA64/IA64TargetMachine.cpp
U    lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
U    lib/Target/IA64/IA64TargetMachine.h
U    lib/Target/IA64/IA64.h
U    lib/Target/MSIL/MSILWriter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.h
U    lib/Target/CellSPU/SPU.h
U    lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.cpp
U    lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
U    lib/Target/Mips/MipsTargetMachine.cpp
U    lib/Target/Mips/MipsTargetMachine.h
U    lib/Target/Mips/Mips.h
U    lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
U    lib/Target/Sparc/SparcTargetMachine.cpp
U    lib/Target/Sparc/SparcTargetMachine.h
U    lib/ExecutionEngine/JIT/TargetSelect.cpp
U    lib/Support/TargetRegistry.cpp

llvm-svn: 75820
2009-07-15 20:24:03 +00:00
David Greene
25d5e84d11 Get rid of postInstructionAction and call EmitComments directly.
llvm-svn: 75806
2009-07-15 18:24:03 +00:00
Dan Gohman
9a193635a4 Fix a typo in a comment that Duncan noticed.
llvm-svn: 75804
2009-07-15 17:38:23 +00:00
Dan Gohman
2224e8e16a Fix a thinko in a comment that Duncan spotted.
llvm-svn: 75803
2009-07-15 17:34:43 +00:00
Dan Gohman
9ced780576 Add a Force option to raw_fd_ostream to specify whether opening
an existing file is considered an error. Convert several tools
to use raw_fd_ostream instead of std::ostream, and to use this
new option instead of doing a manual check.

llvm-svn: 75801
2009-07-15 17:29:42 +00:00
Stuart Hastings
ef732a2bea Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk.

llvm-svn: 75799
2009-07-15 17:27:11 +00:00
Dan Gohman
5ed272db87 Add a raw_ostream version of CheckBitcodeOutputToConsole.
llvm-svn: 75796
2009-07-15 17:04:50 +00:00
Dan Gohman
9f95a90619 Add a comment noting that raw_os_ostream does not check for errors.
llvm-svn: 75794
2009-07-15 16:45:52 +00:00
Dan Gohman
69766f9ade Add a raw_ostream operator<< to sys::Path.
llvm-svn: 75790
2009-07-15 16:33:33 +00:00
Kevin Enderby
312f8559cb Added llvm-mc support for parsing the .dump and .load directives.
llvm-svn: 75786
2009-07-15 15:30:11 +00:00
Duncan Sands
202efbec51 Remove the v3i32 and v3f32 value types: they are not
native for any supported targets.

llvm-svn: 75785
2009-07-15 15:28:52 +00:00
Duncan Sands
765b981647 Remove StringConstantPrefix now that the only user
(llvm-gcc) has gone.

llvm-svn: 75781
2009-07-15 12:39:48 +00:00
Daniel Dunbar
2b67b4ab9f Kill off old (TargetMachine level, not Target level) match quality functions.
llvm-svn: 75780
2009-07-15 12:26:05 +00:00
Daniel Dunbar
51b81c9930 Provide TargetMachine implementations with reference to Target they were created
from.
 - This commit is almost entirely propogating the reference through the
   TargetMachine subclasses' constructor calls.

llvm-svn: 75778
2009-07-15 12:11:05 +00:00
Daniel Dunbar
590904c36b Kill off unused TargetMachineRegistry methods and ivars.
llvm-svn: 75774
2009-07-15 11:48:36 +00:00
Daniel Dunbar
1d5b4e20c9 Migrate llc and the JIT to using the TargetRegistry for lookups.
- They still use the TargetMachineRegistry to populate the contents of the
   -march option (via the listener interface). We can't just populate it in the
   option parser because we can't expect the TargetRegistry to be populated yet
   (we no longer rely on static constructors).

 - There are a couple ways to finish killing off TargetMachineRegistry, but I
   haven't figured out the cleanest one yet...

llvm-svn: 75773
2009-07-15 11:36:15 +00:00
Daniel Dunbar
25ad58480b Include the Target& in the TargetMachineRegisterEntry.
llvm-svn: 75772
2009-07-15 11:23:49 +00:00
Daniel Dunbar
f69bd722c3 Allow multiple registrations of the same target.
- This doesn't necessarily seem like a good idea, but the JIT unittest
   currently relies on it.

llvm-svn: 75769
2009-07-15 10:32:44 +00:00
Daniel Dunbar
14503ce849 Initialize the target info via the InitializeNativeTarget() hook.
llvm-svn: 75768
2009-07-15 10:29:55 +00:00
Daniel Dunbar
61ce410af9 Reimplement TargetMachineRegistry in terms of TargetRegistry.
- This is a temporary hack to aid in incremental refactoring, for now we
   allocate a new TargetMachineRegistryEntry on every getClosest... call.

 - No intended functionality change, other than the leaked memory.

llvm-svn: 75766
2009-07-15 09:53:37 +00:00
Daniel Dunbar
79a15cde61 Mark Target's creation routines as const.
llvm-svn: 75763
2009-07-15 09:38:10 +00:00
Daniel Dunbar
a2af870bd7 Register Target's TargetMachine and AsmPrinter in the new registry.
- This abuses TargetMachineRegistry's constructor for now, this will get
   cleaned up in time.

llvm-svn: 75762
2009-07-15 09:22:31 +00:00
Daniel Dunbar
0e528c0005 Fix thinko
llvm-svn: 75760
2009-07-15 08:56:49 +00:00
Daniel Dunbar
f62be62588 Include Target specific Info initialization routine when initializing all
targets.

llvm-svn: 75756
2009-07-15 07:48:39 +00:00
Daniel Dunbar
18e781dae6 Address some review comments on TargetRegistry.
llvm-svn: 75753
2009-07-15 07:09:29 +00:00
Chris Lattner
48e30f6d1f eliminate the Mangler::PreserveAsmNames bit, the sole client of this
can do it perfectly well itself.

llvm-svn: 75743
2009-07-15 04:50:47 +00:00
Chris Lattner
ac3968ea1d remove printSuffixedName.
llvm-svn: 75742
2009-07-15 04:42:49 +00:00
Daniel Dunbar
cc2e2f1506 Add new TargetRegistry.
Targets implement a single global Target structure which will live in a new
<Target>/TargetInfo library; this will be present in any image which the target
is usable in.
 - Optional target specific classes can then be registered and attached to the
   Target description.

 - Registration for normal Targets will be done via the initialization functions
   instead of using static constructors.

 - This allows clients to use a single interface to obtain target data, without
   requiring the code generator be linked in. It also provides a natural
   extension point for adding new optional target data (assembler parser,
   disassembler, etc.).

 - This also provides a new entry point for obtaining a target for a particular
   triple (without a module).

 - Not yet used, however this should eventually replace the TargetMachineRegistry.

llvm-svn: 75739
2009-07-15 04:24:58 +00:00
Dan Gohman
81885d5b80 Make makeLoopInvariant report whether it made any changes or not,
and use this to simplify more code.

llvm-svn: 75722
2009-07-15 01:25:43 +00:00
Dan Gohman
1e946cc1a7 llvm-c/Core.h is no longer needed in lto.h, and it brings in
several unwanted dependencies.

llvm-svn: 75717
2009-07-15 00:47:00 +00:00
Chris Lattner
32757b2838 Fix a fixme, patch by Ryan Flynn!
llvm-svn: 75716
2009-07-15 00:36:04 +00:00
Kevin Enderby
3e47cf1dda Added llvm-mc support for parsing the .include directive.
llvm-svn: 75711
2009-07-14 23:21:55 +00:00
Owen Anderson
8c85061ee6 Move EVER MORE stuff over to LLVMContext.
llvm-svn: 75703
2009-07-14 23:09:55 +00:00
Kevin Enderby
5821cee99b Added llvm-mc support for parsing the .lsym directive.
llvm-svn: 75685
2009-07-14 21:35:03 +00:00
Chris Lattner
5a0869d540 fix a bug in my previous patch.
llvm-svn: 75678
2009-07-14 20:45:41 +00:00
Chris Lattner
fed67048dc allow default construction of formatted_raw_ostream.
llvm-svn: 75674
2009-07-14 20:33:33 +00:00
David Greene
9c8a1b9b90 Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.

llvm-svn: 75670
2009-07-14 20:18:05 +00:00
Chris Lattner
a62bc404fd Remove some dead functions, patch by Ryan Flynn!
llvm-svn: 75664
2009-07-14 18:58:35 +00:00
Dan Gohman
07b00e1036 Fix a typo that Edwin spotted.
llvm-svn: 75661
2009-07-14 18:52:00 +00:00
Dan Gohman
9b44481454 Add a comment clarifying the role of getPrimitiveTypeSizeInBits.
llvm-svn: 75659
2009-07-14 18:48:32 +00:00
Torok Edwin
bbccd95874 Introduce a pointertracking pass.
For now this only computes the allocated size of the memory pointed to by a
pointer, and offset a pointer from allocated pointer.
The actual checkLimits part will come later, after another round of review.

llvm-svn: 75657
2009-07-14 18:44:28 +00:00
Chris Lattner
6ec578688d Reapply my previous asmprinter changes now with more testing and two
additional bug fixes:

1. The bug that everyone hit was a problem in the asmprinter where it
   would remove $stub but keep the L prefix on a name when emitting the
   indirect symbol.  This is easy to fix by keeping the name of the stub
   and the name of the symbol in a StringMap instead of just keeping a
   StringSet and trying to reconstruct it late.

2. There was a problem printing the personality function.  The current
   logic to print out the personality function from the DWARF information
   is a bit of a cesspool right now that duplicates a bunch of other 
   logic in the asm printer.  The short version of it is that it depends
   on emitting both the L and _ prefix for symbols (at least on darwin)
   and until I can untangle it, it is best to switch the mangler back to
   emitting both prefixes.

llvm-svn: 75646
2009-07-14 18:17:16 +00:00
Kevin Enderby
0b1331c43b Added llvm-mc support for parsing the .desc directive.
llvm-svn: 75645
2009-07-14 18:17:10 +00:00
Dan Gohman
4ce1ac82f7 LLVM doesn't use libelf. Remove libelf configurey.
llvm-svn: 75643
2009-07-14 18:06:25 +00:00
Torok Edwin
f955a6ef49 llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Daniel Dunbar
3d0c94fbbc Revert r75610 (and r75620, which was blocking the revert), in the hopes of
unbreaking llvm-gcc (on Darwin).

--- Reverse-merging r75620 into '.':
U    include/llvm/Support/Mangler.h
--- Reverse-merging r75610 into '.':
U    test/CodeGen/X86/loop-hoist.ll
G    include/llvm/Support/Mangler.h
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
U    lib/VMCore/Mangler.cpp

llvm-svn: 75636
2009-07-14 15:57:55 +00:00
Torok Edwin
e5683aabc1 After converting assert(0) to LLVM_UNREACHABLE we lost file/line location.
Fix by making the LLVM_UNREACHABLE pass __FILE__ and __LINE__ to
llvm_unreachable.

llvm-svn: 75631
2009-07-14 12:49:22 +00:00
Daniel Dunbar
21b7f85dc3 ProfileInfo interface tweaks.
- Add getExecutionCount(const Function).

 - Add helper Edge type.

 - constify.

 - No functionality change.

llvm-svn: 75623
2009-07-14 06:58:59 +00:00
Chris Lattner
492f8619a2 remove renamed method.
llvm-svn: 75620
2009-07-14 06:22:15 +00:00
Bob Wilson
c6cae712d9 Remove some tabs and fix other whitespace. No functional changes.
llvm-svn: 75613
2009-07-14 06:11:12 +00:00
Bob Wilson
f37517af8c Fix a comment.
llvm-svn: 75612
2009-07-14 06:09:50 +00:00
Chris Lattner
b0e0d16efb Change the X86 asmprinter to use the mangler to apply suffixes like "$non_lazy_ptr"
to symbols instead of doing it with "printSuffixedName".  This gets us to the point
where there is a real separation between computing a symbol name and printing it,
something I need for MC printer stuff.

This patch also fixes a corner case bug where unnamed private globals wouldn't get
the private label prefix.

Next up, rename all uses of getValueName -> getMangledName for better greppability,
and then tackle the ppc/arm backends to eliminate "printSuffixedName".

llvm-svn: 75610
2009-07-14 06:04:35 +00:00
Lang Hames
7238ca2267 New VNInfo alignment patch by Ryan Flynn.
llvm-svn: 75609
2009-07-14 05:46:55 +00:00
Chris Lattner
2a6bb9bc51 Change the internal interface to makeNameProper to take a bool that
indicates whether the label is private or not, instead of taking
prefix stuff.  One effect of this is that symbols will be generated
with *just* the private prefix, instead of both the private prefix
*and* the user-label-prefix, but this doesn't matter as long as it
is consistent.  For example we'll now get "Lfoo" instead of "L_foo".
These are just assembler temporary labels anyway, so they never even
make it into the .o file.

llvm-svn: 75607
2009-07-14 04:50:12 +00:00
Lang Hames
19644baf4c Unbroke LiveInterval.
llvm-svn: 75588
2009-07-14 02:17:17 +00:00
Lang Hames
2600777dac Tidy up VNInfo alignment code. Patch contributed by Ryan Flynn.
llvm-svn: 75587
2009-07-14 02:05:37 +00:00
Dan Gohman
80062e52e0 Introduce a new LoopInfo utility function makeLoopInvariant, which
works similar to isLoopInvariant, except that it will do trivial
hoisting to try to make the value loop invariant if it isn't already.
This makes it easier for transformation passes to clear trivial
instructions out of the way (the regular LICM pass doesn't run
until relatively late). This is code factored out of LoopSimplify
and other places.

llvm-svn: 75578
2009-07-14 01:06:29 +00:00
Devang Patel
4992f3bed3 Do not use Mangler to remove '1' from linkage name.
llvm-svn: 75574
2009-07-14 00:55:28 +00:00
Bob Wilson
cb91024983 Revert 75308.
llvm-svn: 75565
2009-07-14 00:16:03 +00:00
Eli Friedman
88f1b31a57 Fix obvious typo.
llvm-svn: 75563
2009-07-14 00:09:42 +00:00
Chris Lattner
6460e403a7 rename Memo/Count to AnonGlobalIDs/NextAnonGlobalID to be more
descriptive.  Thange them to keep track of the ID of a global that is
assigned, not the first mangled name returned for it.  Without doing this,
we are required to always use the same suffix for a global that gets 
mangled.  This means that we can mangle the same global once with $stub
and another time with $non_lazy_ptr or whatever.

llvm-svn: 75561
2009-07-14 00:01:06 +00:00
Owen Anderson
1404d6e7d1 Move more functionality over to LLVMContext.
llvm-svn: 75559
2009-07-13 23:50:59 +00:00
Chris Lattner
1b09927043 remove Mangler::getTypeID and related data, it was only used for mangling
local symbols and we haven't had type planes since llvm 1.9.

llvm-svn: 75558
2009-07-13 23:50:53 +00:00
Chris Lattner
4ea397f845 remove mangler support for mangling local names. Mangler should only be
used with globals.

llvm-svn: 75557
2009-07-13 23:47:27 +00:00
Owen Anderson
9ff3b6191e Move a bit more functionality to LLVMContext, which apparently wasn't being used anyways.
llvm-svn: 75546
2009-07-13 23:16:26 +00:00
Kevin Enderby
af095fcfb8 Added llvm-mc support for parsing the .abort directive.
llvm-svn: 75545
2009-07-13 23:15:14 +00:00
Dan Gohman
8e93bc202e Forward-declare Loop and LoopInfo instead of #including LoopInfo.h.
llvm-svn: 75529
2009-07-13 22:19:41 +00:00
Owen Anderson
3501454313 These don't really need contexts either.
llvm-svn: 75528
2009-07-13 22:18:28 +00:00
Dan Gohman
9a7df22e10 Move isLCSSAForm, isLoopInvariant, getCanonicalInductionVariable,
and related functions out of LoopBase and into Loop, since they
are specific to BasicBlock-based loops. This also allows the code
to be moved out-of-line.

llvm-svn: 75523
2009-07-13 22:02:44 +00:00
Dan Gohman
f6caa6f1e3 Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,
using the Curiously Recurring Template Pattern with LoopBase.

This will help further refactoring, and future functionality for
Loop. Also, Headers can now foward-declare Loop, instead of pulling
in LoopInfo.h or doing tricks.

llvm-svn: 75519
2009-07-13 21:51:15 +00:00
Devang Patel
af27c5b2bd Use AsmPrinter's Mangler to remove leading '1' from linkage names.
llvm-svn: 75515
2009-07-13 21:48:26 +00:00
Dan Gohman
a9953c0a28 Reapply 75252, with a fix to avoid the infinite recursion case. The
check for avoiding re-analyzing a widening cast needed to happen
earlier, as getSCEV itself may result in a isLoopGuardedByCond query.

llvm-svn: 75511
2009-07-13 21:35:55 +00:00
Owen Anderson
7b2ee7dc21 As Chris pointed out, this doesn't actually need an LLVMContext to operate.
llvm-svn: 75508
2009-07-13 21:27:19 +00:00
Kevin Enderby
a461788d6a add llvm-mc support for parsing the .subsections_via_symbols directive.
llvm-svn: 75500
2009-07-13 21:03:15 +00:00
Owen Anderson
1e5155161a Move more functionality over to LLVMContext.
llvm-svn: 75497
2009-07-13 20:58:05 +00:00
Dan Gohman
bf3719359b Convert SCEV from FoldingSetNode to FastFoldingSetNode. This eliminates
a bunch of redundent code in Profile methods, and prepares for upcoming
changes to do improved memoization.

llvm-svn: 75494
2009-07-13 20:50:19 +00:00
Dan Gohman
19222a6572 Delete a spurious const.
llvm-svn: 75493
2009-07-13 20:46:11 +00:00
David Greene
814f6a648f Add infrastructure to allow post instruction printing action triggers.
We'll eventually use this to print comments in asm files and do other
fun things.

This adds interfaces to the AsmPrinter and changes TableGen to invoke
the postInstructionAction when appropriate.  It also add parameters to
TargetAsmInfo to control comment layout.

llvm-svn: 75490
2009-07-13 20:25:48 +00:00
Chris Lattner
adc834d034 Add NetBSD to the Triple class, patch by Krister Walfridsson!
llvm-svn: 75489
2009-07-13 20:22:23 +00:00
Dan Gohman
9a19e608d4 Add an optional optimization to FoldingSet to allow ID values to be
stored rather than recomputed on each bucket traversal.

llvm-svn: 75480
2009-07-13 18:25:44 +00:00
David Greene
0dbe5b0a97 Make some more changes suggested by Chris. Manipulators go away.
llvm-svn: 75472
2009-07-13 16:49:27 +00:00
Owen Anderson
393d8b0a0c Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context.  This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.

llvm-svn: 75445
2009-07-13 04:09:18 +00:00
Daniel Dunbar
c6592df02d Match declaration to definition.
llvm-svn: 75440
2009-07-12 23:50:34 +00:00
Daniel Dunbar
e79e475000 Match declaration to definition.
llvm-svn: 75438
2009-07-12 22:46:08 +00:00
Chris Lattner
d3eba0efb8 remove llvm.part.set.* and llvm.part.select.*. They have never been
implemented in codegen, have no frontend to generate them, and are 
better implemented with pattern matching (like the ppc backend does
to generate rlwimi/rlwinm etc).

PR4543

llvm-svn: 75430
2009-07-12 21:08:53 +00:00
Torok Edwin
d2f2458584 Mention that llvm_report_error() does not return.
llvm-svn: 75428
2009-07-12 21:01:44 +00:00
Jakob Stoklund Olesen
3f85980927 Add CCIfSRet calling convention predicate.
The blackfin calling convention uses a different register for sret arguments.

llvm-svn: 75417
2009-07-12 13:15:50 +00:00
Nick Lewycky
31db02e0ba Make this clearer for the mathematically inclined. Thanks to Duncan Sands for
going over the text!

llvm-svn: 75414
2009-07-12 05:44:08 +00:00
Nick Lewycky
d3d5cfa475 Revert r75252 which was causing some crashes at compile time.
llvm-svn: 75384
2009-07-11 20:38:25 +00:00
Torok Edwin
2efc9fcd4c Fix comment.
llvm-svn: 75380
2009-07-11 20:13:58 +00:00
Torok Edwin
ae8a3ff177 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Nick Lewycky
58a6fd9824 Clarify and simplify.
llvm-svn: 75366
2009-07-11 17:04:01 +00:00
Nick Lewycky
fee40fdcd9 Move a method that creates constant ranges relative to another constant range
per icmp predicate out of predsimplify and into ConstantRange.

Add another utility method that determines whether one range is a subset of
another. Combine with the former to determine whether icmp pred range, range
is known to be true or not.

llvm-svn: 75357
2009-07-11 06:15:39 +00:00
Bob Wilson
48729a2025 Add new vector types for 192-bit, 348-bit and 512-bit sizes.
These are needed to represent ARM Neon struct datatypes containing 2, 3 or 4
separate vectors.

llvm-svn: 75308
2009-07-10 23:05:09 +00:00
Chris Lattner
84bf9fed2b add support for .zerofill, patch by Kevin Enderby!
llvm-svn: 75301
2009-07-10 22:20:30 +00:00
David Greene
a60479705b Make changes suggested by Chris and eliminate newly-added raw_ostream
hooks as they're no longer needed.

The major change with this patch is to make formatted_raw_ostream usable
by any client of raw_ostream.

llvm-svn: 75283
2009-07-10 21:14:44 +00:00
Jeffrey Yasskin
4ada36ff60 Regenerate configure after r75279.
llvm-svn: 75280
2009-07-10 21:09:55 +00:00
Jeffrey Yasskin
4f8961d587 Add a --with-oprofile flag to configure, which uses OProfile's agent
library to tell it the addresses of JITted functions.  For a
particular program, this changes the opreport -l output from:

samples %    image name        symbol name
48182  98.9729 anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000) anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000)
11     0.0226  libstdc++.so.6.0.9    /usr/lib/libstdc++.so.6.0.9

to:

samples %    image name        symbol name
24565  60.7308 19814.jo        fib_left
15365  37.9861 19814.jo        fib_right
22     0.0544  ld-2.7.so       do_lookup_x

llvm-svn: 75279
2009-07-10 21:08:20 +00:00
Dan Gohman
5749595b5b Remove ScalarEvolution::hasSCEV, which isn't being used, and which
breaks encapsulation. Also remove a dead prototype for setSCEV.

llvm-svn: 75272
2009-07-10 20:25:29 +00:00
Evan Cheng
52ce32d097 Remove TargetInstrInfo::CommuteChangesDestination and added findCommutedOpIndices which returns the operand indices which are swapped (when applicable). This allows for some code clean up and future enhancements.
llvm-svn: 75264
2009-07-10 19:15:51 +00:00
Owen Anderson
565efa7c72 Fix unit tests.
llvm-svn: 75262
2009-07-10 18:58:29 +00:00
Chris Lattner
c2ed857dfb add missing *, patch by Peter O'Gorman!
llvm-svn: 75259
2009-07-10 18:28:19 +00:00
Owen Anderson
add7163c0d Push LLVMContext through the TypeBuilder API. There are no users for this in-tree, so I can't really test it.
If you're using this, and it's broken, please send patches.

llvm-svn: 75257
2009-07-10 18:10:10 +00:00
Owen Anderson
7076f1ffb7 Push LLVMContext through the PatternMatch API.
llvm-svn: 75255
2009-07-10 17:35:01 +00:00
Dan Gohman
404a92e330 Generalize ScalarEvolution's cast-folding code to support more kinds
of loops. Add several new functions to for working with ScalarEvolution's
add-hoc value-range analysis functionality.

llvm-svn: 75252
2009-07-10 16:42:52 +00:00
Evan Cheng
e25ef2e60e 80 col violation.
llvm-svn: 75226
2009-07-10 05:20:19 +00:00
Owen Anderson
1500792c2c Finish pushing LLVMContext through the IRBuilder/ConstantFolder interface.
llvm-svn: 75213
2009-07-10 00:49:53 +00:00
David Greene
a3a442fd55 Fix #include specification.
llvm-svn: 75208
2009-07-10 00:34:39 +00:00
Ted Kremenek
ec0e24ae25 ImmutableMap/ImmutableSet: Allow caching of ImutAVLTree digests while the tree
is still mutable. My experiments show this reduces the amount of times we
compute a full tree digest by over 50% on very small cases, and potentially much
larger on others.

llvm-svn: 75207
2009-07-10 00:33:43 +00:00
David Greene
7ee78e9d5c Redesign this to avoid standard stream classes. This stream class
provides pretty -printing of comments and other such things in asm
files.

llvm-svn: 75202
2009-07-09 23:56:35 +00:00
Owen Anderson
49226b1075 This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?
llvm-svn: 75200
2009-07-09 23:48:35 +00:00
David Greene
98610d5cfd Add some hooks that a redesigned AsmStream needs to do its job. These
allow derived classes to examine the stream buffer before it's flushed.

llvm-svn: 75199
2009-07-09 23:43:41 +00:00
Dan Gohman
8a58b8f83b Revert the part of 75177 that split ConstantRange into two classes, and
merge the new functionality and unittests into ConstantRange. Thanks to
Nick Lewycky for pointing out that it isn't necessary to have two separate
classes here.

llvm-svn: 75191
2009-07-09 23:16:10 +00:00
Andreas Bolka
1f4a3d9bf8 Fix typo, trailing whitespace.
llvm-svn: 75179
2009-07-09 22:14:25 +00:00
Dan Gohman
33251eff97 Add a ConstantSignedRange class, which does for signed integers
what ConstantRange does for unsigned integers. Factor out a
common base class for common functionality.

Add some new functions for performing arithmetic on constant
ranges. Some of these are currently just stubbed out with
conservative implementations.

Add unittests for ConstantRange and ConstantSignedRange.

llvm-svn: 75177
2009-07-09 22:07:27 +00:00
Eli Friedman
08991c716a Make EXTRACT_VECTOR_ELT a bit more flexible in terms of the returned
value.  Adjust other code to deal with that correctly.  Make 
DAGTypeLegalizer::PromoteIntRes_EXTRACT_VECTOR_ELT take advantage of 
this new flexibility to simplify the code and make it deal with unusual 
vectors (like <4 x i1>) correctly.  Fixes PR3037.

llvm-svn: 75176
2009-07-09 22:01:03 +00:00
Owen Anderson
03965f5212 As Chris pointed out, we don't actually need to pass the context around here.
llvm-svn: 75161
2009-07-09 18:44:09 +00:00
Chris Lattner
1fc5ed8460 back out r75156 for now.
llvm-svn: 75160
2009-07-09 18:41:57 +00:00
Owen Anderson
98aa906e73 A little bit more LLVMContextification.
llvm-svn: 75159
2009-07-09 18:36:20 +00:00
Ted Kremenek
c089dcb368 ImmutableSet/ImmutableMap: Allow caching of null digests by properly using a flag to record if the digest of an ImutAVLTree has been cached.
llvm-svn: 75157
2009-07-09 18:34:41 +00:00
David Greene
3f79ac95c2 Add some classes to produce pretty-printed asm. We'll use these
shortly to provide nicely printed comments and other goodies in
asm files.

llvm-svn: 75156
2009-07-09 18:27:23 +00:00
Owen Anderson
8970999512 Thread LLVMContext through MVT and related parts of SDISel.
llvm-svn: 75153
2009-07-09 17:57:24 +00:00
Alisdair Meredith
b74a1f546f Resolve undefined behaviour when ManagedStatic is instantiated with a fixed-length array type.
llvm-svn: 75149
2009-07-09 17:26:16 +00:00
Chris Lattner
56638bb644 add llvm-mc support for parsing the .lcomm directive, patch by Kevin Enderby!
llvm-svn: 75148
2009-07-09 17:25:12 +00:00
David Greene
3612687754 Add support for other GraphViz display tools. This can help
with very large graphs, where dot isn't necessarily the 
most visually pleasing way of looking at the graph.

llvm-svn: 75144
2009-07-09 17:06:18 +00:00
Nick Lewycky
98ec5dd5cc Forgot a couple files when adding the -ssi-everything pass.
llvm-svn: 75136
2009-07-09 15:33:55 +00:00
Sanjiv Gupta
44bc8c8ee1 Add a -t="dir" option to the driver. This can be used to specify the directory to be used as TempDir if somebody doesn't want to use the standard /tmp.
llvm-svn: 75121
2009-07-09 08:23:38 +00:00
Evan Cheng
4f87295872 Targets sometimes assign fixed stack object to spill certain callee-saved
registers based on dynamic conditions. For example, X86 EBP/RBP, when used as
frame register has to be spilled in the first fixed object. It should inform
PEI this so it doesn't get allocated another stack object. Also, it should not
be spilled as other callee-saved registers but rather its spilling and restoring
are being handled by emitPrologue and emitEpilogue. Avoid spilling it twice.

llvm-svn: 75116
2009-07-09 06:53:48 +00:00
Chris Lattner
f2112b9d1a add default ctor.
llvm-svn: 75114
2009-07-09 06:44:01 +00:00
Chris Lattner
c31744f99b add missing predicate.
llvm-svn: 75103
2009-07-09 04:56:23 +00:00
Lang Hames
ceb80b14d3 Improved tracking of value number kills. VN kills are now represented
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.

A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test 
condition has been updated to reflect this.

llvm-svn: 75097
2009-07-09 03:57:02 +00:00
Jeffrey Yasskin
a34904f9f8 Work around an ICE in gcc-4.2.4.
llvm-svn: 75084
2009-07-09 00:52:44 +00:00
Douglas Gregor
71dae1f1ba Make SmallPtrSet iterators real iterators
llvm-svn: 75073
2009-07-08 23:53:54 +00:00
Jeffrey Yasskin
2ef60bd58a Add an option to allocate JITed global data separately from code. By
default, this option is not enabled to support clients who rely on
this behavior.

Fixes http://llvm.org/PR4483

A patch to allocate additional memory for globals after we run out is
forthcoming.

Patch by Reid Kleckner!

llvm-svn: 75059
2009-07-08 21:59:57 +00:00
David Greene
c78823a40d Reformat.
llvm-svn: 75058
2009-07-08 21:57:46 +00:00
David Greene
d185fbe8a1 Allow users of GraphWriter to display graphs asynchronously. This
provides a way to quickly dump a bunch of graph information to dot files
and display them.  It's a timesaver when working on large systems.

llvm-svn: 75056
2009-07-08 21:53:41 +00:00
David Greene
87dbe0a3b5 Add an ExecuteNoWait interface to support asynchronous process spawning.
llvm-svn: 75055
2009-07-08 21:46:40 +00:00
Torok Edwin
358888da3a Implement changes from Chris's feedback.
Finish converting lib/Target.

llvm-svn: 75043
2009-07-08 20:53:28 +00:00
Owen Anderson
9331034838 Push LLVMContext _back_ through IRBuilder.
llvm-svn: 75040
2009-07-08 20:50:47 +00:00
Dan Gohman
05e65cf9e4 Make the code that updates ScalarEvolution's internal state in response
to a loop deletion more thorough. Don't prune the def-use tree search at
instructions that don't have SCEVs computed, because an instruction with
a user that has a computed SCEV may itself lack a computed SCEV.  Also,
remove loop-related values from the ValuesAtScopes and
ConstantEvolutionLoopExitValues maps as well.

This fixes a regression in 483.xalancbmk.

llvm-svn: 75030
2009-07-08 19:23:34 +00:00
Torok Edwin
980729667e Convert more abort() calls to llvm_report_error().
Also remove trailing semicolon.

llvm-svn: 75027
2009-07-08 19:04:27 +00:00
Owen Anderson
332aae685b Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
llvm-svn: 75025
2009-07-08 19:03:57 +00:00
Torok Edwin
ad3be984b7 Start converting to new error handling API.
cerr+abort -> llvm_report_error
assert(0)+abort -> LLVM_UNREACHABLE (assert(0)+llvm_unreachable-> abort() included)

llvm-svn: 75018
2009-07-08 18:01:40 +00:00
Chris Lattner
b19709485f convert comments to doxygen style
llvm-svn: 75015
2009-07-08 17:09:18 +00:00
Alisdair Meredith
6be064d4d6 Trial first commit
Fixed build, requires std header before using std::string

llvm-svn: 74995
2009-07-08 09:04:19 +00:00
Nick Lewycky
d46a7b2d22 Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.

llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Owen Anderson
7a1f69e433 Push LLVMContext through GlobalVariables and IRBuilder.
llvm-svn: 74985
2009-07-08 01:26:06 +00:00
Chris Lattner
ea7bd9b484 dag combine sext(setcc) -> vsetcc before legalize. To make this safe,
VSETCC must define all bits, which is different than it was documented
to before.  Since all targets that implement VSETCC already have this
behavior, and we don't optimize based on this, just change the 
documentation.  We now get nice code for vec_compare.ll

llvm-svn: 74978
2009-07-08 00:31:33 +00:00
Owen Anderson
ca017b9679 LLVMContext-ification.
llvm-svn: 74973
2009-07-07 23:43:39 +00:00
Bob Wilson
5178063d06 Change NEON vldN/vstN intrinsics to specify "N" as an immediate operand
instead of having a separate intrinsic for each value.

llvm-svn: 74958
2009-07-07 22:27:20 +00:00
Devang Patel
3559cabb97 Disable loop index split for now and let nightly tester verify its usefulness.
llvm-svn: 74955
2009-07-07 22:09:42 +00:00
Dan Gohman
015eeb8ecb Fix a typo and a grammaro in a comment.
llvm-svn: 74947
2009-07-07 20:47:48 +00:00
Chris Lattner
2bea79b45b Implement parsing support for the .comm directive. Patch by
Kevin Enderby!

llvm-svn: 74944
2009-07-07 20:30:46 +00:00
Chris Lattner
f480b139c8 fix a bug in post-order iterators with external storage, patch by
Olaf Krzikalla!

llvm-svn: 74933
2009-07-07 18:43:48 +00:00
Chris Lattner
2bbbcbca79 fix some type confusion in ReadVBR64: "Piece" should be only 32 bits,
not 64, because we read at most 32 bits at a time.  OTOH, "Result" must
be 64-bits and insertion into it must be 64-bit clean.  Thanks to Ivan
Sorokin for bringing this up.

llvm-svn: 74932
2009-07-07 18:39:49 +00:00
Owen Anderson
75f0f1cc6c Have scoped mutexes take referenes instead of pointers.
llvm-svn: 74931
2009-07-07 18:33:04 +00:00
Chris Lattner
786a1039f4 "BinaryObject.h was implicitly converting between uint{16,32,64}_t to
uint8_t (via 'foo & 255'), i replaced this with an explicit (uint8_t)
cast which is equivalent, faster and more correct (silences
type-related warnings). Also, following coding standards I replaced
post-increment with pre-increment."

Patch by Ryan Flynn!

llvm-svn: 74929
2009-07-07 18:28:00 +00:00
Bill Wendling
2bd8631feb Remove unused parameter.
llvm-svn: 74928
2009-07-07 18:21:19 +00:00
Chris Lattner
ccaba64332 Eliminate the static constructors and locks from DynamicLibrary.cpp.
This fixes PR4512 and eliminating static ctors is always good.  Losing
thread safety is unfortunate, but the code is just incredibly poorly
designed.

If someone is interested, the "right" solution is to split
DynamicLibrary.cpp into two separate pieces: a stateless piece in
libsystem, and a simple support file in libsupport that has the
"state" (e.g.  AddSymbol) in managed static objects.

Doing this would both fix memory leaks we already have, as well as make
the code thread safe again.  it would also make sense to move all the
unix specific code in System/DynamicLibrary.cpp into 
System/Unix/DynamicLibrary.inc.

llvm-svn: 74927
2009-07-07 18:17:07 +00:00
Chris Lattner
b11fca33f8 remove dead code, noone creates instances of "DynamicLibrary", so the ctor and dtor are dead.
llvm-svn: 74926
2009-07-07 18:01:58 +00:00
Torok Edwin
375564339a Introduce new error handling API.
This will replace exit()/abort() style error handling with an API
that allows clients to register custom error handling hooks.
The default is to call exit(1) when no error handler is provided.

llvm-svn: 74922
2009-07-07 17:32:34 +00:00
Owen Anderson
9647245825 Re-LLVMContext-ize DebugInfo, now with less breakage.
llvm-svn: 74920
2009-07-07 17:12:53 +00:00
Dan Gohman
dd7f97c496 Change all SCEV* to SCEV *.
llvm-svn: 74918
2009-07-07 17:06:11 +00:00
Owen Anderson
2a4b3fbb3b This parameter should default to true, not false.
llvm-svn: 74915
2009-07-07 16:56:05 +00:00
Mikhail Glushenkov
a863ad48e7 s/llvmc2/llvmc/
llvm-svn: 74906
2009-07-07 16:09:05 +00:00
Mikhail Glushenkov
a1d8f36bb7 Add an 'init' option property.
Makes possible to provide default values for options defined in plugins (same as
cl::init).

llvm-svn: 74905
2009-07-07 16:08:41 +00:00
Devang Patel
619bba465f Add isMetadata() to check metadata operand.
llvm-svn: 74883
2009-07-06 23:46:02 +00:00
Devang Patel
7959284f86 Add new ValueType for metadata.
llvm-svn: 74882
2009-07-06 23:44:32 +00:00
Owen Anderson
121f736d9c "LLVMContext* " --> "LLVMContext *"
llvm-svn: 74878
2009-07-06 23:00:19 +00:00
Owen Anderson
5f268720e9 Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's through the ValueTracking API.
llvm-svn: 74873
2009-07-06 22:37:39 +00:00
Owen Anderson
ad3229d281 Thread LLVMContext through the constant folding APIs, which touches a lot of files.
llvm-svn: 74844
2009-07-06 18:42:36 +00:00
Chris Lattner
e1ec806ad2 Add two new accessors to the C bindings, patch by Wladimir van der Laan!
llvm-svn: 74836
2009-07-06 17:29:59 +00:00
Bruno Cardoso Lopes
c28df0f408 Just forgot to include the two new files
llvm-svn: 74814
2009-07-06 05:16:40 +00:00
Bruno Cardoso Lopes
38373542a1 Add the Object Code Emitter class. Original patch by Aaron Gray, I did some
cleanup, removed some #includes and moved Object Code Emitter out-of-line.

llvm-svn: 74813
2009-07-06 05:09:34 +00:00
Owen Anderson
977aa11bc6 More LLVMContext-ification.
llvm-svn: 74807
2009-07-05 22:41:43 +00:00
Nick Lewycky
c7655d0328 There are five floating point types.
llvm-svn: 74806
2009-07-05 22:35:49 +00:00
Nick Lewycky
27cfb5984c There are *four* lights!
llvm-svn: 74804
2009-07-05 22:23:28 +00:00
Jeffrey Yasskin
f8a1b98154 Have cmake define HAVE_STRERROR and friends to 1 when they're defined at all.
llvm-svn: 74791
2009-07-04 16:37:12 +00:00
Owen Anderson
a8ce571a68 Even more passes being LLVMContext'd.
llvm-svn: 74781
2009-07-03 19:42:02 +00:00
Nick Lewycky
b01a2dc7ba Add Static Single Information construction pass written by André Tavares!
Use it by requiring it through the pass manager, then calling its createSSI
method on the variables that you want in SSI form.

llvm-svn: 74780
2009-07-03 19:28:36 +00:00
Duncan Sands
e431120ddc In this unreachable code, return an initialized value.
This stops gcc warning about possible uses of an uninitialized
value when compiling with assertions turned off.

llvm-svn: 74775
2009-07-03 16:00:23 +00:00
Duncan Sands
a585a43092 Fix the build: provide uint8_t.
llvm-svn: 74769
2009-07-03 08:12:51 +00:00
Tilmann Scheller
37389b484a Implement the SVR4 ABI for PowerPC.
Implement LowerFORMAL_ARGUMENTS_SVR4().
Implement LowerCALL_SVR4().
Add support for split arguments.
Implement by value parameter passing for aggregates.
Add support for variable argument lists.
Create the spill area for argument registers of variable argument functions no longer at a fixed offset.
Make sure callee saved registers are spilled to the correct stack offsets.
Change allocation order of non-volatile floating-point registers.
Add VRSAVE to the list of callee-saved registers, add CallConvLowering for vararg calls.
Add support for variable argument calls with Vector arguments.
Add support for VR and VRSAVE save area, improve allocation order for non-volatile vector registers.
Stop creating illegal i8 values in LowerVASTART().
Add memory access width hints.
Make sure to reserve space on the stack for the frame pointer.
When using the SVR4 ABI, reserve r13 for the Small Data Area pointer.
Assure that the frame pointer is spilled to the correct location on the stack.
Some FP registers were not marked as volatile.
Make sure the i64 words from a long double are passed either both in registers or both on the stack.
Only put integer arguments in registers which are not marked with the inreg flag.

llvm-svn: 74765
2009-07-03 06:45:56 +00:00
Tilmann Scheller
cea3c16aa5 Add NumFixedArgs attribute to CallSDNode which indicates the number of fixed arguments in a vararg call.
With the SVR4 ABI on PowerPC, vector arguments for vararg calls are passed differently depending on whether they are a fixed or a variable argument. Variable vector arguments always go into memory, fixed vector arguments are put 
into vector registers. If there are no free vector registers available, fixed vector arguments are put on the stack.

The NumFixedArgs attribute allows to decide for an argument in a vararg call whether it belongs to the fixed or variable portion of the parameter list.

llvm-svn: 74764
2009-07-03 06:44:53 +00:00
Owen Anderson
487dacd60c Fill in a few more missing accessors.
llvm-svn: 74739
2009-07-02 23:58:19 +00:00
Chris Lattner
d49e5380ec switch the .ll parser to use SourceMgr.
llvm-svn: 74735
2009-07-02 23:08:13 +00:00
Chris Lattner
739a32b190 switch the .ll parser into SMDiagnostic.
llvm-svn: 74734
2009-07-02 22:46:18 +00:00
Devang Patel
5f93a737f6 Simplify debug info intrisinc lowering.
llvm-svn: 74733
2009-07-02 22:43:26 +00:00
Chris Lattner
1e3e84eb39 add an explicit class for holding llvm::SourceMgr diagnostics and use
it to print them.  This gives us column numbers in the diag line.  Before:

t.s:4: error: unexpected token in argument list
 mov %eax %edx
          ^

now:
t.s:4:11: error: unexpected token in argument list
 mov %eax %edx
          ^

llvm-svn: 74732
2009-07-02 22:24:20 +00:00
Owen Anderson
b0d428b228 Make the current LLVMContext available to passes.
llvm-svn: 74724
2009-07-02 20:23:41 +00:00
Owen Anderson
5c79283f31 Add an accessor to Function so that Passes can easily get access to the context.
llvm-svn: 74714
2009-07-02 18:03:58 +00:00