1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

14158 Commits

Author SHA1 Message Date
Rafael Espindola
cefc38659a Assume .cfi_startproc is the first thing in a function. If the function is
externally visable, create a local symbol to use in the CFE. If not, use the
function label itself.

Fixes PR10420.

llvm-svn: 136716
2011-08-02 20:24:22 +00:00
Roman Divacky
7453a0dcd6 Sketch out PowerPC ELF writer. This is enough to get clang -integrated-as
to compile a working hello world on FreeBSD/PPC32.

llvm-svn: 136689
2011-08-02 15:51:38 +00:00
Andrew Trick
86f6a3c645 Use consistent terminology for loop exit/exiting blocks. Name change only.
llvm-svn: 136677
2011-08-02 04:23:35 +00:00
Eli Friedman
564f52b2bf Fix a couple silly typos in IRBuilder in the new atomic instructions.
llvm-svn: 136665
2011-08-02 00:45:35 +00:00
Owen Anderson
4ee266955a Add a clear() operation to MCInst, to drop all of its operands. Useful for the disassembler, where we may realize fairly late into decoding that something is wrong and need to reset.
llvm-svn: 136634
2011-08-01 18:43:18 +00:00
Jakub Staszak
db23d8b195 Add BlockFrequency::getEntryFrequency()
llvm-svn: 136618
2011-08-01 15:22:10 +00:00
Jay Foad
f5b5b93126 The operands of a GlobalAlias are always Constants. Simplify things
accordingly.

llvm-svn: 136608
2011-08-01 12:20:36 +00:00
Bill Wendling
8a625cebd2 Add the 'resume' instruction for the new EH rewrite.
This adds the 'resume' instruction class, IR parsing, and bitcode reading and
writing. The 'resume' instruction resumes propagation of an existing (in-flight)
exception whose unwinding was interrupted with a 'landingpad' instruction (to be
added later).

llvm-svn: 136589
2011-07-31 06:30:59 +00:00
Bill Wendling
57ddbb84ac Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444,
r136445, r136446, r136253 pending review.

llvm-svn: 136556
2011-07-30 05:42:50 +00:00
Jakob Stoklund Olesen
7b77f35a1b 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
02fa079dc3 Add more constantness in BranchProbabilityInfo.
llvm-svn: 136502
2011-07-29 19:30:00 +00:00
David Greene
5927323d9c 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
6f2419f1a2 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
e4090cc864 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
f6797ffc9a 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
6076fe7cff If run with -debug give more information about Cyclic Probability.
llvm-svn: 136403
2011-07-28 21:46:58 +00:00
Bill Wendling
dba29efd6f Use ArrayRef instead of requiring an std::vector.
llvm-svn: 136396
2011-07-28 21:25:33 +00:00
Bill Wendling
22f729dcfb 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
22fcf6c40b Fix stupid mistake from commit 136381.
llvm-svn: 136384
2011-07-28 20:17:18 +00:00
Jakub Staszak
534e099ba0 Speed up BlockFrequencyInfo a little bit.
llvm-svn: 136381
2011-07-28 20:09:31 +00:00
Duncan Sands
beab1f4882 This file was moved from Support to ADT. Correct a comment.
llvm-svn: 136344
2011-07-28 08:36:22 +00:00
Nick Lewycky
31d1c92d69 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
b75e5fc784 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
03445c79b9 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
a95f22ea2b 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
842ea169de Code generation for 'fence' instruction.
llvm-svn: 136283
2011-07-27 22:21:52 +00:00
Jakub Staszak
f5076015fc Use BlockFrequency instead of uint32_t in BlockFrequencyInfo.
llvm-svn: 136278
2011-07-27 22:05:51 +00:00
Bill Wendling
b20cfdfe95 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
Ted Kremenek
ee0970dabc 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
29ef880b52 Move static methods to the anonymous namespace.
llvm-svn: 136221
2011-07-27 15:51:51 +00:00
Jakub Staszak
d5378ec61f Edge to itself is backedge as well.
llvm-svn: 136219
2011-07-27 15:42:09 +00:00
Eli Friedman
f226974353 Misc mid-level changes for new 'fence' instruction.
llvm-svn: 136205
2011-07-27 01:08:30 +00:00
Eli Friedman
2da127e60a 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
bff9934d9a Support .code32 and .code64 in X86 assembler.
llvm-svn: 136197
2011-07-27 00:38:12 +00:00
Eli Friedman
22e4c4d12d 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
ae93f1bf46 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
8b264d3264 Strip trailing whitespace.
llvm-svn: 136099
2011-07-26 17:19:30 +00:00
Duncan Sands
0a14a12b51 Teach the Triple class about kfreebsd (FreeBSD kernel with
a GNU userspace).

llvm-svn: 136085
2011-07-26 15:30:04 +00:00
Jay Foad
fe750c827a Fix typo in comment.
llvm-svn: 136068
2011-07-26 09:36:52 +00:00
Evan Cheng
8e380354c4 Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObjectStreamer.
llvm-svn: 136031
2011-07-26 00:42:34 +00:00
Evan Cheng
2e96785311 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
2a0a4e1a73 Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
llvm-svn: 136010
2011-07-25 23:24:55 +00:00
Eli Friedman
50291d09da 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
58e5fd1f16 Fix include guards.
llvm-svn: 135998
2011-07-25 22:52:04 +00:00
Jakub Staszak
ddeb8772c8 BranchProbability::print returns void now.
llvm-svn: 135994
2011-07-25 22:27:42 +00:00
Jakub Staszak
b4bffb255a Add BlockFrequency class.
llvm-svn: 135992
2011-07-25 22:24:51 +00:00
Evan Cheng
1d04cd9b26 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
171cc8d07d Fix class description.
llvm-svn: 135948
2011-07-25 20:08:58 +00:00
Jakub Staszak
2873980483 Fix #include guard directive.
llvm-svn: 135947
2011-07-25 20:08:00 +00:00
Jakub Staszak
5c309cbead Rename BlockFrequency to BlockFrequencyInfo and MachineBlockFrequency to
MachineBlockFrequencyInfo.

llvm-svn: 135937
2011-07-25 19:25:40 +00:00
Jay Foad
278089b983 Remove uses of std::vector from TypeBuilder.
llvm-svn: 135906
2011-07-25 10:32:27 +00:00
Jay Foad
4f279f9a6f Use ArrayRef in the (protected) constructors of ConstantArray, ConstantStruct and ConstantVector.
llvm-svn: 135905
2011-07-25 10:14:44 +00:00
Jay Foad
6513dac6e2 Convert GetElementPtrInst to use ArrayRef.
llvm-svn: 135904
2011-07-25 09:48:08 +00:00
Chris Lattner
489601c923 switch Triple to take twines instead of stringrefs.
llvm-svn: 135889
2011-07-24 20:45:08 +00:00
Chris Lattner
0e3472660b Add Twine support for characters, and switch twine to use a union internally
to eliminate some casting.

llvm-svn: 135888
2011-07-24 20:44:30 +00:00
Frits van Bommel
e238f52543 Omit explicit length here, now that I've had a chance to test this with gcc.
llvm-svn: 135867
2011-07-24 09:53:46 +00:00
Benjamin Kramer
40ed4c3e06 Fix a silly off by one.
llvm-svn: 135842
2011-07-23 03:04:46 +00:00
Benjamin Kramer
35d7f76497 Add more constness.
llvm-svn: 135838
2011-07-23 01:40:15 +00:00
Benjamin Kramer
a1e84a1998 Turn the DenseSet in MCRegisterClass into a tblgenerated bit field. This should be faster and smaller.
Goodbye static ctors and dtors!

llvm-svn: 135836
2011-07-23 00:47:49 +00:00
Benjamin Kramer
0fc2a68e8f Give TargetRegisterClass a pointer to the MCRegisterClass and use it to access its data.
This makes TargetRegisterClass slightly slower. Next step will be making contains faster.
Eventually TargetRegisterClass will be killed entirely.

llvm-svn: 135835
2011-07-23 00:47:46 +00:00
Evan Cheng
13d54fc7c9 Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.
llvm-svn: 135833
2011-07-23 00:45:41 +00:00
NAKAMURA Takumi
0912faa08f CMake: Fix LLVM_NATIVE_TARGETMC in config.h.cmake.
llvm-svn: 135832
2011-07-23 00:45:23 +00:00
NAKAMURA Takumi
e8c8f7fe0e config.h.cmake: Reorder along config.h.in.
llvm-svn: 135831
2011-07-23 00:45:16 +00:00
Andrew Trick
53ed0491c0 Move trip count discovery outside of the generic LoopUnroll helper. This
removes its dependence on canonical induction variables.

llvm-svn: 135829
2011-07-23 00:33:05 +00:00
Oscar Fuentes
260c1b0c41 Teach cmake configured headers about LLVM_NATIVE_TARGETMC
llvm-svn: 135820
2011-07-22 22:21:47 +00:00
Evan Cheng
7b4cb12a95 Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,
InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC.

llvm-svn: 135812
2011-07-22 21:58:54 +00:00
Bill Wendling
a289f709aa Add a method to set the compact unwind info.
llvm-svn: 135806
2011-07-22 21:17:05 +00:00
Bill Wendling
2eea7949c2 Add a method to get the list of FrameInfos.
llvm-svn: 135805
2011-07-22 21:16:32 +00:00
Jay Foad
42463ed852 Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
ArrayRef.

llvm-svn: 135761
2011-07-22 08:16:57 +00:00
Chandler Carruth
0ad63a1326 Move the logic for printing the registered targets into a static
function on the TargetRegistry. Also clean it up and use the modern LLVM
utility libraries available instead of rolling a few things manually.

llvm-svn: 135756
2011-07-22 07:50:44 +00:00
Chandler Carruth
6931004b83 Add an extension point to the CommandLine library where clients can
register extra version information to be printed. This is designed to
allow those tools which link in various targets to also print those
registered targets under --version.

Currently this printing logic is embedded into the Support library
directly; a huge layering violation. This is the first step to hoisting
it out into the tools without adding lots of duplicated code.

llvm-svn: 135755
2011-07-22 07:50:40 +00:00
Jakub Staszak
cf5ebedf56 Allow getBlockFreq to return 0.
llvm-svn: 135742
2011-07-22 02:24:57 +00:00
Benjamin Kramer
eca22965a3 Teach tblgen to emit MCRegisterClasses.
- This currently introduces more instances of the static DenseSet dtor, but that should be fixable.

llvm-svn: 135735
2011-07-22 00:44:39 +00:00
Benjamin Kramer
6ab8d85f64 Initialize DenseSets lazily.
llvm-svn: 135717
2011-07-21 23:03:59 +00:00
Benjamin Kramer
727a49e530 Sink parts of TargetRegisterClass into MCRegisterClass.
llvm-svn: 135683
2011-07-21 17:26:50 +00:00
Jay Foad
d4458dd707 Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

llvm-svn: 135673
2011-07-21 14:31:17 +00:00
Jay Foad
5d70c8e85d Update llvm-gcc-4.2 and dragonegg after converting ConstantFolder APIs
to use ArrayRef.

llvm-svn: 135672
2011-07-21 09:19:11 +00:00
Jay Foad
483a783217 Convert ConstantFolder APIs to use ArrayRef.
llvm-svn: 135671
2011-07-21 07:52:17 +00:00
Chris Lattner
c4ab50bd33 move tier out of an anonymous namespace, it doesn't make sense
to for it to be an an anon namespace and be in a header.

Eliminate some extraenous uses of tie.

llvm-svn: 135669
2011-07-21 06:21:31 +00:00
Bill Wendling
55eb4a26d9 Remove the now defunct getCompactUnwindEncoding method from the frame lowering code.
llvm-svn: 135634
2011-07-20 23:04:09 +00:00
Devang Patel
284b502be9 There are two ways to map a variable to its lexical scope. Lexical scope information is embedded in MDNode describing the variable. It is also available as a part of DebugLoc attached with DBG_VALUE instruction. DebugLoc attached with an instruction is less reliable in optimized code so use information embedded in the MDNode.
llvm-svn: 135629
2011-07-20 22:18:50 +00:00
Evan Cheng
c9bc5a9011 Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.
There is still a bit more refactoring left to do in Targets. But we are now very
close to fixing all the layering issues in MC.

llvm-svn: 135611
2011-07-20 19:50:42 +00:00
Eric Christopher
a7456220ba Regenerate configure and friends for Chad.
llvm-svn: 135592
2011-07-20 17:04:49 +00:00
Evan Cheng
55d7fcc5f7 - Move CodeModel from a TargetMachine global option to MCCodeGenInfo.
- Introduce JITDefault code model. This tells targets to set different default
  code model for JIT. This eliminates the ugly hack in TargetMachine where
  code model is changed after construction.

llvm-svn: 135580
2011-07-20 07:51:56 +00:00
Evan Cheng
380dc98371 Add MCObjectFileInfo and sink the MCSections initialization code from
TargetLoweringObjectFileImpl down to MCObjectFileInfo.

TargetAsmInfo is done to one last method. It's *almost* gone!

llvm-svn: 135569
2011-07-20 05:58:47 +00:00
Devang Patel
65afdd27d0 Distinguish between two copies of one inlined variable.
llvm-svn: 135528
2011-07-19 22:31:15 +00:00
Owen Anderson
ad0f17c102 Enhance the FixedLengthDecoder to be able to generate plausible-looking decoders for ARM.
llvm-svn: 135524
2011-07-19 21:06:00 +00:00
Devang Patel
5a4bb57ec5 Reapply r135457. This needs llvm-gcc change, that I forgot to check-in yesterday.
llvm-svn: 135504
2011-07-19 19:41:54 +00:00
Bob Wilson
7c9092c9aa Revert "Make a provision to encode inline location in a variable. This will enable dwarf writer to easily distinguish between two instances of a inlined variable in one basic block."
This reverts commit 9fec5e346efdf744b151ae6604f912908315fa7a.

llvm-svn: 135486
2011-07-19 16:32:50 +00:00
Jay Foad
bbbf29aab7 Convert SimplifyGEPInst to use ArrayRef.
llvm-svn: 135482
2011-07-19 15:07:52 +00:00
Jay Foad
83a0e1fa99 Convert gep_type_begin and gep_type_end to use ArrayRef.
llvm-svn: 135481
2011-07-19 14:42:50 +00:00
Jay Foad
0974b71f17 Convert TargetData::getIndexedOffset to use ArrayRef.
llvm-svn: 135478
2011-07-19 14:01:37 +00:00
Jay Foad
ae5894c5cc Use ArrayRef in ConstantFoldInstOperands and ConstantFoldCall.
llvm-svn: 135477
2011-07-19 13:32:40 +00:00
Richard Osborne
b469141419 Add intrinsics for the zext / sext instructions.
llvm-svn: 135476
2011-07-19 13:28:50 +00:00
Richard Osborne
50303e0d38 Add intrinsics for the testct, testwct instructions.
llvm-svn: 135475
2011-07-19 13:00:40 +00:00
Richard Osborne
409c0d7768 Add intrinsics for the peek and endin instructions.
llvm-svn: 135474
2011-07-19 12:50:25 +00:00
Evan Cheng
bfc0cac54d Introduce MCCodeGenInfo, which keeps information that can affect codegen
(including compilation, assembly). Move relocation model Reloc::Model from
TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine.

llvm-svn: 135468
2011-07-19 06:37:02 +00:00
Eli Friedman
99b95e531f Make isLoadExtLegal and isTruncStoreLegal check what the name says. :) This might have some minor effect on CellSPU, but all other targets should be unaffected. Fixing per report from Damien Vincent on llvmdev.
llvm-svn: 135462
2011-07-19 02:24:07 +00:00
Devang Patel
e50d45c876 Make a provision to encode inline location in a variable. This will enable dwarf writer to easily distinguish between two instances of a inlined variable in one basic block.
llvm-svn: 135457
2011-07-19 01:03:32 +00:00
Devang Patel
72886ba8d8 Revert r135423.
llvm-svn: 135454
2011-07-19 00:28:24 +00:00
Bill Wendling
6211e2602f Add a method to set compact unwind encoding information in a frame.
llvm-svn: 135449
2011-07-19 00:01:42 +00:00
Bill Wendling
b1d5a0798a Rename CompactEncoding to CompactUnwindEncoding.
llvm-svn: 135448
2011-07-19 00:00:58 +00:00
Bill Wendling
408386e3ef Add a field for the compact unwind encoding.
llvm-svn: 135446
2011-07-19 00:00:05 +00:00
Bill Wendling
203796ee7a Move the compact encoding from the target-specific library to the code-gen
library.

llvm-svn: 135443
2011-07-18 23:38:40 +00:00
Evan Cheng
5ad7d33696 Eliminate TargetAsmInfo::getCompactUnwindEncoding. This get rid of the
use of TargetFrameLowering in TargetAsmInfo.

llvm-svn: 135439
2011-07-18 22:32:12 +00:00
Evan Cheng
10c6820ff4 Move getInitialFrameState from TargetFrameInfo to MCAsmInfo (suggestions for
better location welcome).

llvm-svn: 135438
2011-07-18 22:29:13 +00:00
Jeffrey Yasskin
2e0f2a0985 Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity
errors like the one corrected by r135261.  Migrate all LLVM callers of the old
constructor to the new one.

llvm-svn: 135431
2011-07-18 21:45:40 +00:00
Evan Cheng
561d71ce7b Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo down
to MCRegisterInfo. Also initialize the mapping at construction time.

This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step
towards fixing the layering violation.

llvm-svn: 135424
2011-07-18 20:57:22 +00:00
Devang Patel
389cb9d8c6 During bottom up fast-isel, instructions emitted to materalize registers are at top of basic block and do not have debug location. This may misguide debugger while entering the basic block and sometimes debugger provides semi useful view of current location to developer by picking up previous known location as current location. Assign a sensible location to the first instruction in a basic block, if it does not have one location derived from source file, so that debugger can provide meaningful user experience to developers in edge cases.
[take 2]

llvm-svn: 135423
2011-07-18 20:55:23 +00:00
Chris Lattner
320e39de40 various cleanups noticed by Frits
llvm-svn: 135396
2011-07-18 16:35:57 +00:00
Chris Lattner
e909e2936b remove pasto
llvm-svn: 135394
2011-07-18 16:04:11 +00:00
Frits van Bommel
107d4e0957 Hopefully fix some GCC-based buildbots. GCC apparently decays the array to a pointer here before overload resolution, so construct with an explicit length instead.
llvm-svn: 135391
2011-07-18 12:31:03 +00:00
Frits van Bommel
6c24f9c277 Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used.
Mostly mechanical with some manual reformatting.

llvm-svn: 135390
2011-07-18 12:00:32 +00:00
Frits van Bommel
9286081ccc Introduce the 'makeArrayRef(...)' family of functions, which fills a similar role for ArrayRef<> as std::make_pair() fills for std::pair<>: they return the right instantiation of ArrayRef<T> based on the types of the parameters.
They mostly mirror the ArrayRef constructors, with two exceptions:
 * There's no function mirroring the default constructor because it wouldn't have any parameters to deduce the right ArrayRef<T> from.
 * There's an explicit SmallVector<T> overload in addition to the SmallVectorImpl<T> overload. Without it, the single-element overload would try to create an ArrayRef<Smallvector<T> > because it's a better match according to the overloading rules. (And both overloads are used in the current tree, so neither is redundant)

llvm-svn: 135389
2011-07-18 11:58:53 +00:00
Chris Lattner
e1fe7061ce land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Chris Lattner
009603a6d2 add iteration support to TinyPtrVector for clang's use.
llvm-svn: 135367
2011-07-18 01:53:11 +00:00
Chris Lattner
04b988a1c0 fix a warning in TinyPtrVector, adopt it in SSAUpdater, saving some
mallocs.

llvm-svn: 135366
2011-07-18 01:43:58 +00:00
Chris Lattner
fde62dcdb7 introduce a new TinyPtrVector class.
llvm-svn: 135365
2011-07-18 01:40:02 +00:00
Jakub Staszak
7bd3be24d8 Remove "LoopInfo.h" include from BranchProbabilityInfo.h.
llvm-svn: 135353
2011-07-16 20:31:15 +00:00
Jakub Staszak
a0010953f7 Add MachineBlockFrequency analysis.
llvm-svn: 135352
2011-07-16 20:23:20 +00:00
Andrew Trick
b2c2eec80d Fix SCEVEXpander to handle arbitrary phi expansion. Includes two
related bug fixes and corresponding assertions for uninitialized data
and missing NULL check. Test cases will be included with the new LFTR.

llvm-svn: 135333
2011-07-16 00:59:39 +00:00
Chris Lattner
7fc89c5ff8 deconstify getType()'s.
llvm-svn: 135323
2011-07-15 23:15:45 +00:00
Jakob Stoklund Olesen
987cd08002 Extract parts of RAGreedy::splitAroundRegion as SplitKit methods.
This gets rid of some of the gory splitting details in RAGreedy and
makes them available to future SplitKit clients.

Slightly generalize the functionality to support multi-way splitting.
Specifically, SplitEditor::splitLiveThroughBlock() supports switching
between different register intervals in a block.

llvm-svn: 135307
2011-07-15 21:47:57 +00:00
Benjamin Kramer
5836701780 Teach llvm-objdump to disassemble sections symbol by symbol.
llvm-svn: 135289
2011-07-15 18:39:24 +00:00
Benjamin Kramer
5936e08079 ObjectFile: Add a method to check whether a section contains a symbol.
- No ELF or COFF implementation yet, I don't have a way to test that.
  Should be straightforward to add though.

llvm-svn: 135288
2011-07-15 18:39:21 +00:00
Jay Foad
c826df8fb7 Convert CallInst and InvokeInst APIs to use ArrayRef.
llvm-svn: 135265
2011-07-15 08:37:34 +00:00
Jeffrey Yasskin
4d5d3fceaa Add an APFloat::convertToInt(APSInt) function that automatically manages the
memory for the result.

llvm-svn: 135259
2011-07-15 07:04:56 +00:00
Chris Lattner
609591194a remove the old and dangerous uncheckedReplaceAllUsesWith method,
which was just replaceAllUsesWith without some assertions.  It was
needed back when type refinement was alive.

llvm-svn: 135253
2011-07-15 06:18:52 +00:00
Chris Lattner
6274327fff devirtualize Constant::isNullValue:
4 files changed, 15 insertions(+), 60 deletions(-)

llvm-svn: 135252
2011-07-15 06:14:08 +00:00
Chris Lattner
e99d93799f add CFP::isNegative() and ConstnatInt::isNegative() methods.
Devirtualize the isNegativeZeroValue method.

llvm-svn: 135249
2011-07-15 05:58:04 +00:00
Chris Lattner
aba8e40670 remove the InvalidateStructLayoutInfo API, which is dead and unnecessary now
that type refinement is toast.

llvm-svn: 135245
2011-07-15 05:21:59 +00:00
Evan Cheng
1ae06d95e0 Move some parts of TargetAsmInfo down to MCAsmInfo. This is not the greatest
solution but it is a small step towards removing the horror that is
TargetAsmInfo.

llvm-svn: 135237
2011-07-15 02:09:41 +00:00
Evan Cheng
9e8f90a020 Rename createAsmInfo to createMCAsmInfo and move registration code to MCTargetDesc to prepare for next round of changes.
llvm-svn: 135219
2011-07-14 23:50:31 +00:00
Devang Patel
369cd5cef5 Add dump()
llvm-svn: 135200
2011-07-14 21:50:04 +00:00
Benjamin Kramer
25ffda4d8a Add a new field to MCOperandInfo that contains information about the type of the Operand.
- The actual values are from the MCOI::OperandType enum.
- Teach tblgen to read it from the instruction definition.
- This is a better implementation of the hacks in edis.

llvm-svn: 135197
2011-07-14 21:47:18 +00:00
Chris Lattner
5bf752bcf4 The key of a StringMap can contain nul's in it, so having first() return
const char* doesn't make sense.  Have it return StringRef instead.

llvm-svn: 135167
2011-07-14 18:31:43 +00:00
Chris Lattner
b3458315d4 consolidate GlobalValue::isDeclaration into one
non-virtual function.

llvm-svn: 135163
2011-07-14 18:10:41 +00:00
Benjamin Kramer
a6129829fa Change Intrinsic::getDeclaration and friends to take an ArrayRef.
llvm-svn: 135154
2011-07-14 17:45:39 +00:00
Evan Cheng
3d2be55d6c Unfortunately several files in MC are badly violating layering rule by using
TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are
other cases of violations, but this is probably the worst.

This patch is but one small step towards fixing this. 500 more steps to go. :-(

llvm-svn: 135131
2011-07-14 05:43:07 +00:00
Devang Patel
1856a523ea Simplify and delay extracting DebugLoc elements, scope and InlinedAt, as much as possible.
llvm-svn: 135124
2011-07-14 01:14:57 +00:00
Owen Anderson
c68f12ff30 Add a target-indepedent entry to MCInstrDesc to describe the encoded size of an opcode. Switch ARM over to using that rather than its own special MCInstrDesc bits.
llvm-svn: 135106
2011-07-13 23:22:26 +00:00
Evan Cheng
7bdc771798 Fix up TargetLoweringObjectFile ctors to properly initialize fields.
llvm-svn: 135068
2011-07-13 19:54:59 +00:00
Jim Grosbach
e0fc4019f9 Update MCParsedAsmOperand debug methods.
Update the debug output interface for MCParsedAsmOperand to have a print()
method which takes an output stream argument, an << operator which invokes
the print method using the given stream, and a dump() method which prints
the operand to the dbgs() stream. This makes the interface more consistent
with the rest of LLVM, and more convenient to use at the debugger command
line.

llvm-svn: 135043
2011-07-13 15:34:57 +00:00
Jay Foad
88fb4f4597 Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.
llvm-svn: 135040
2011-07-13 10:26:04 +00:00
Jay Foad
eaccc60d30 Add some bits that I found useful when converting InsertValueInst and
ExtractValueInst APIs to use ArrayRef: a new constructor taking a
(begin, end) range, and operators == and != for element-wise comparison.

llvm-svn: 135039
2011-07-13 09:15:05 +00:00
Danil Malyshev
e297cd5195 Add to RuntimeDyld support different object formats
llvm-svn: 135037
2011-07-13 07:57:58 +00:00
Bill Wendling
bd3639ccc1 There is a cyclic dependency between MC and Target if this method is out-of-line.
llvm-svn: 135006
2011-07-12 22:35:01 +00:00
Benjamin Kramer
dec02ef53a Delete StructType bodies when destroying a StructType.
Leak found by valgrind.

llvm-svn: 134994
2011-07-12 18:22:07 +00:00
Jay Foad
cbe48cd2ac Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

llvm-svn: 134982
2011-07-12 14:06:48 +00:00
Tobias Grosser
449d23f471 Remove IntegerType constness from TargetData
llvm-svn: 134978
2011-07-12 11:36:58 +00:00