Jakob Stoklund Olesen
9760f04ef9
Add an isSSA() flag to MachineRegisterInfo.
...
This flag is true from isel to register allocation when the machine
function is required to be in SSA form. The TwoAddressInstructionPass
and PHIElimination passes clear the flag.
The SSA flag wil be used by the machine code verifier to check for SSA
form, and eventually an assertion can enforce it in +Asserts builds.
This will catch the common target error of creating machine code with
multiple defs of a virtual register.
llvm-svn: 136532
2011-07-29 22:51:22 +00:00
Jakub Staszak
efd94c8fea
Add more constantness in BranchProbabilityInfo.
...
llvm-svn: 136502
2011-07-29 19:30:00 +00:00
David Greene
ea844f0bc9
Add a std::string Wrapper for TableGen
...
Create a std::string wrapper for use as a DenseMap key. DenseMap is
not safe in generate with strings, so this wrapper indicates that only
strings guaranteed not to have certain values should be used in the
DenseMap.
llvm-svn: 136481
2011-07-29 19:06:58 +00:00
Eli Friedman
adec587d5c
Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to be
...
working on x86 (at least for trivial testcases); other architectures will
need more work so that they actually emit the appropriate instructions for
orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC,
Mips, and Alpha backends need such changes.)
llvm-svn: 136457
2011-07-29 03:05:32 +00:00
Bill Wendling
7fa7fe6b58
Add the AddLandingPadInfo function.
...
AddLandingPadInfo takes a landingpad instruction and grabs all of the
information from it that it needs for EH table generation.
llvm-svn: 136429
2011-07-28 23:42:57 +00:00
Eli Friedman
c9a551ebed
LangRef and basic memory-representation/reading/writing for 'cmpxchg' and
...
'atomicrmw' instructions, which allow representing all the current atomic
rmw intrinsics.
The allowed operands for these instructions are heavily restricted at the
moment; we can probably loosen it a bit, but supporting general
first-class types (where it makes sense) might get a bit complicated,
given how SelectionDAG works.
As an initial cut, these operations do not support specifying an alignment,
but it would be possible to add if we think it's useful. Specifying an
alignment lower than the natural alignment would be essentially
impossible to support on anything other than x86, but specifying a greater
alignment would be possible. I can't think of any useful optimizations which
would use that information, but maybe someone else has ideas.
Optimizer/codegen support coming soon.
llvm-svn: 136404
2011-07-28 21:48:00 +00:00
Jakub Staszak
07f0f02bc5
If run with -debug give more information about Cyclic Probability.
...
llvm-svn: 136403
2011-07-28 21:46:58 +00:00
Bill Wendling
f8d95bc4c6
Use ArrayRef instead of requiring an std::vector.
...
llvm-svn: 136396
2011-07-28 21:25:33 +00:00
Bill Wendling
4f027233d2
The personality function should be a Function* and not just a Value*.
...
llvm-svn: 136392
2011-07-28 21:14:13 +00:00
Jakub Staszak
14852b182e
Fix stupid mistake from commit 136381.
...
llvm-svn: 136384
2011-07-28 20:17:18 +00:00
Jakub Staszak
d7ac43eed1
Speed up BlockFrequencyInfo a little bit.
...
llvm-svn: 136381
2011-07-28 20:09:31 +00:00
Duncan Sands
5710211af0
This file was moved from Support to ADT. Correct a comment.
...
llvm-svn: 136344
2011-07-28 08:36:22 +00:00
Nick Lewycky
3255d1d25f
In DenseMapInfo<pair<T, U>> tombstone key, use the tombstone for T and U instead
...
of the empty key for U. This shouldn't really matter because the tombstone key
for the pair was still distinct from every other key, but it is odd. Patch by
Michael Ilseman!
llvm-svn: 136336
2011-07-28 06:48:33 +00:00
Bill Wendling
4c93488999
Make sure that the landingpad instruction takes a Constant* as the clause's value.
...
llvm-svn: 136326
2011-07-28 02:27:12 +00:00
Bill Wendling
a8f04e3034
Add a couple of convenience functions:
...
* InvokeInst: Get the landingpad instruction associated with this invoke.
* LandingPadInst: A method to reserve extra space for clauses.
llvm-svn: 136325
2011-07-28 02:15:52 +00:00
Argyrios Kyrtzidis
348937de07
Add an optional 'bool makeAbsolute' in llvm::sys::fs::unique_file function.
...
If true and 'model' parameter is not an absolute path, a temp directory will be prepended.
Make it true by default to match current behaviour.
llvm-svn: 136310
2011-07-28 00:29:20 +00:00
Eli Friedman
26a484852e
Code generation for 'fence' instruction.
...
llvm-svn: 136283
2011-07-27 22:21:52 +00:00
Jakub Staszak
da3df4302a
Use BlockFrequency instead of uint32_t in BlockFrequencyInfo.
...
llvm-svn: 136278
2011-07-27 22:05:51 +00:00
Bill Wendling
2641d132d1
Keep enums stable. Append EH stuff to the end.
...
llvm-svn: 136263
2011-07-27 21:00:28 +00:00
Bill Wendling
6c923bb8d9
Merge the contents from exception-handling-rewrite to the mainline.
...
This adds the new instructions 'landingpad' and 'resume'.
llvm-svn: 136253
2011-07-27 20:18:04 +00:00
Eli Friedman
4fc946cc71
The numbering of LLVMOpcode is supposed to be stable; revert my earlier change, and append Fence onto the end.
...
llvm-svn: 136245
2011-07-27 18:59:19 +00:00
Ted Kremenek
666bec46a0
Add a generic 'capacity_in_bytes' function to allow inspection of memory usage of various data structures.
...
llvm-svn: 136233
2011-07-27 18:40:45 +00:00
Jakub Staszak
a9e8aa0482
Move static methods to the anonymous namespace.
...
llvm-svn: 136221
2011-07-27 15:51:51 +00:00
Jakub Staszak
107339e31a
Edge to itself is backedge as well.
...
llvm-svn: 136219
2011-07-27 15:42:09 +00:00
Eli Friedman
89b694b096
Misc mid-level changes for new 'fence' instruction.
...
llvm-svn: 136205
2011-07-27 01:08:30 +00:00
Eli Friedman
ae8161e774
Fix AliasSetTracker so that it doesn't make any assumptions about instructions it doesn't know about (like the atomic instructions I'm adding).
...
llvm-svn: 136198
2011-07-27 00:46:46 +00:00
Evan Cheng
481ebb0133
Support .code32 and .code64 in X86 assembler.
...
llvm-svn: 136197
2011-07-27 00:38:12 +00:00
Eli Friedman
4e8e257d58
Fix a couple minor mistakes pointed out by Bill in adding 'fence' instruction.
...
llvm-svn: 136124
2011-07-26 20:24:06 +00:00
Andrew Trick
3ca3f98c2c
SCEV: Added a data structure for storing not-taken info per loop
...
exit. Added an interfaces for querying either the loop's exact/max
backedge taken count or a specific loop exit's not-taken count.
llvm-svn: 136100
2011-07-26 17:19:55 +00:00
Duncan Sands
6d473aa378
Strip trailing whitespace.
...
llvm-svn: 136099
2011-07-26 17:19:30 +00:00
Duncan Sands
fe44f67d43
Teach the Triple class about kfreebsd (FreeBSD kernel with
...
a GNU userspace).
llvm-svn: 136085
2011-07-26 15:30:04 +00:00
Rafael Espindola
b84dc6bca8
Add LLVMAddAlwaysInlinerPass to the C API.
...
llvm-svn: 136083
2011-07-26 15:23:23 +00:00
Rafael Espindola
be2fe29f9c
LLVM 3.0 is here, remove old do nothing method.
...
llvm-svn: 136082
2011-07-26 15:17:32 +00:00
Jay Foad
6a51402a8a
Fix typo in comment.
...
llvm-svn: 136068
2011-07-26 09:36:52 +00:00
Evan Cheng
3a79225b4c
Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObjectStreamer.
...
llvm-svn: 136031
2011-07-26 00:42:34 +00:00
Evan Cheng
1142444565
Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser.
...
llvm-svn: 136027
2011-07-26 00:24:13 +00:00
Evan Cheng
5928e69d20
Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
...
llvm-svn: 136010
2011-07-25 23:24:55 +00:00
Eli Friedman
fee02c6c13
Initial implementation of 'fence' instruction, the new C++0x-style replacement for llvm.memory.barrier.
...
This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon.
llvm-svn: 136009
2011-07-25 23:16:38 +00:00
Evan Cheng
1740a97734
Fix include guards.
...
llvm-svn: 135998
2011-07-25 22:52:04 +00:00
Jakub Staszak
e92d047b51
BranchProbability::print returns void now.
...
llvm-svn: 135994
2011-07-25 22:27:42 +00:00
Jakub Staszak
49993f26bf
Add BlockFrequency class.
...
llvm-svn: 135992
2011-07-25 22:24:51 +00:00
Rafael Espindola
e96fd5a4fe
Add LLVMAddTargetLibraryInfo to the C API.
...
llvm-svn: 135975
2011-07-25 21:20:54 +00:00
Rafael Espindola
7281395c8c
Add LLVMAddLowerExpectIntrinsicPass to the C API.
...
llvm-svn: 135966
2011-07-25 20:57:59 +00:00
Evan Cheng
f60768a14e
Fix last bits of MC layer issues. llvm-mc doesn't need to initialize TargetMachine's anymore.
...
llvm-svn: 135963
2011-07-25 20:53:02 +00:00
Jakub Staszak
12bc09c843
Fix class description.
...
llvm-svn: 135948
2011-07-25 20:08:58 +00:00
Jakub Staszak
4e48f3df16
Fix #include guard directive.
...
llvm-svn: 135947
2011-07-25 20:08:00 +00:00
Jakub Staszak
875ebd5f5d
Rename BlockFrequency to BlockFrequencyInfo and MachineBlockFrequency to
...
MachineBlockFrequencyInfo.
llvm-svn: 135937
2011-07-25 19:25:40 +00:00
Jay Foad
a9f7959897
Remove uses of std::vector from TypeBuilder.
...
llvm-svn: 135906
2011-07-25 10:32:27 +00:00
Jay Foad
89d9b81a3a
Use ArrayRef in the (protected) constructors of ConstantArray, ConstantStruct and ConstantVector.
...
llvm-svn: 135905
2011-07-25 10:14:44 +00:00
Jay Foad
d1b7849d49
Convert GetElementPtrInst to use ArrayRef.
...
llvm-svn: 135904
2011-07-25 09:48:08 +00:00