Commit Graph

15229 Commits

Author SHA1 Message Date
David Blaikie
c1bddefc56 Simplify llvm:🆑:Option by using a bit field instead of manual bit packing.
This still preserves the same total layout.

Previously it looked like:
*** Dumping AST Record Layout
   0 | class llvm:🆑:Option
   0 |   (Option vtable pointer)
   8 |   int NumOccurrences
  12 |   int Flags
  16 |   unsigned int Position
  20 |   unsigned int AdditionalVals
  24 |   class llvm:🆑:Option * NextRegistered
  32 |   const char * ArgStr
  40 |   const char * HelpStr
  48 |   const char * ValueStr
  sizeof=56, dsize=56, align=8
  nvsize=56, nvalign=8

Now it looks like:
*** Dumping AST Record Layout
   0 | class llvm:🆑:Option
   0 |   (Option vtable pointer)
   8 |   int NumOccurrences
  12 |   enum NumOccurrencesFlag Occurrences
  12 |   unsigned int Value
  12 |   enum OptionHidden HiddenFlag
  12 |   enum FormattingFlags Formatting
  13 |   unsigned int Misc
  16 |   unsigned int Position
  20 |   unsigned int AdditionalVals
  24 |   class llvm:🆑:Option * NextRegistered
  32 |   const char * ArgStr
  40 |   const char * HelpStr
  48 |   const char * ValueStr
  sizeof=56, dsize=56, align=8
  nvsize=56, nvalign=8

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148736 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 22:22:44 +00:00
Rafael Espindola
16d7d437e0 Add support for .cfi_signal_frame. Fixes pr11762.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148733 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 21:51:52 +00:00
Chris Lattner
e55bbfe145 Various public StringMap methods take or return "MapEntryTy", make it public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148732 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 21:42:52 +00:00
Chris Lattner
0adabe5a08 revert r148688 too, this isn't safe for DenseMap use. When DenseMap resizes, it will need to copy around arbitrary pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148699 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 15:10:41 +00:00
Chris Lattner
cef3925698 allow OwningPtr to be copy constructed if null, which is required to
make them be a valuetype in a DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148688 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 08:19:57 +00:00
Evgeniy Stepanov
7908480e4c An option to selectively enable parts of ARM EHABI support.
This change adds an new value to the --arm-enable-ehabi option that
disables emitting unwinding descriptors. This mode gives a working
backtrace() without the (currently broken) exception support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148686 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 07:57:39 +00:00
Rafael Espindola
603d6b56a2 The iteration order over a std::set<Module*> depends on the addresses of the
modules. Avoid that to make the order the linker sees the modules deterministic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148676 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 03:41:53 +00:00
Eli Bendersky
381e2bee65 Remove trailing spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-22 09:26:00 +00:00
Eli Bendersky
24973c1063 Basic runtime dynamic loading capabilities added to ELFObjectFile, implemented
in a subclass named DyldELFObject. This class supports rebasing the object file
it represents by re-mapping section addresses to the actual memory addresses
the object was placed in. This is required for MC-JIT implementation on ELF with
debugging support.

Patch reviewed on llvm-commits.

Developed together with Ashok Thirumurthi and Andrew Kaylor.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148653 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-22 09:01:03 +00:00
Jakob Stoklund Olesen
8c47ad8c47 Handle register masks in LiveVariables.
A register mask operand kills any live physreg that isn't preserved.
Unlike an implicit-def operand, the clobbered physregs are never live
afterwards.

This means LiveVariables has to track a much smaller number of live
physregs, and it should spend much less time in addRegisterDead().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148609 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-21 00:58:53 +00:00
Jakob Stoklund Olesen
4888d5e98c Delete an unused member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148594 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 22:48:59 +00:00
David Blaikie
4d6ccb5f68 More dead code removal (using -Wunreachable-code)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 21:51:11 +00:00
Benjamin Kramer
88e900808a Don't use my favorite C++11 feature (comma at end of enum).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148555 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 18:08:30 +00:00
Kostya Serebryany
164b86b439 Extend Attributes to 64 bits
Problem: LLVM needs more function attributes than currently available (32 bits).
One such proposed attribute is "address_safety", which shows that a function is being checked for address safety (by AddressSanitizer, SAFECode, etc).

Solution:
- extend the Attributes from 32 bits to 64-bits
- wrap the object into a class so that unsigned is never erroneously used instead
- change "unsigned" to "Attributes" throughout the code, including one place in clang.
- the class has no "operator uint64 ()", but it has "uint64_t Raw() " to support packing/unpacking.
- the class has "safe operator bool()" to support the common idiom:  if (Attributes attr = getAttrs()) useAttrs(attr);
- The CTOR from uint64_t is marked explicit, so I had to add a few explicit CTOR calls
- Add the new attribute "address_safety". Doing it in the same commit to check that attributes beyond first 32 bits actually work.
- Some of the functions from the Attribute namespace are worth moving inside the class, but I'd prefer to have it as a separate commit.

Tested:
"make check" on Linux (32-bit and 64-bit) and Mac (10.6)
built/run spec CPU 2006 on Linux with clang -O2.


This change will break clang build in lib/CodeGen/CGCall.cpp.
The following patch will fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148553 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 17:56:17 +00:00
Benjamin Kramer
3feccbaaee Protect SmallVectorImpl's constructor and a few other methods that aren't meant to be public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148550 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 16:39:46 +00:00
Andrew Trick
b5c26ef9da SCEVExpander fixes. Affects LSR and indvars.
LSR has gradually been improved to more aggressively reuse existing code, particularly existing phi cycles. This exposed problems with the SCEVExpander's sloppy treatment of its insertion point. I applied some rigor to the insertion point problem that will hopefully avoid an endless bug cycle in this area. Changes:

- Always used properlyDominates to check safe code hoisting.

- The insertion point provided to SCEV is now considered a lower bound. This is usually a block terminator or the use itself. Under no cirumstance may SCEVExpander insert below this point.

- LSR is reponsible for finding a "canonical" insertion point across expansion of different expressions.

- Robust logic to determine whether IV increments are in "expanded" form and/or can be safely hoisted above some insertion point.

Fixes PR11783: SCEVExpander assert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148535 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 07:41:13 +00:00
Owen Anderson
7b672fe03b Add a new form of MCOperand, for representing sub-instructions. This is intended for supporting bundles through the MC layer, rather than lowering them pre-MC as we currently do for Thumb2 IT blocks. Since these sub-instruction operands hold pointers to the sub-instructions, it is the responsibility of the target's AsmPrinter to provide storage for them for the duration of the EmitInstruction() call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148492 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 19:24:37 +00:00
Evan Cheng
ef2887d348 More bundle related API additions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148465 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 07:47:03 +00:00
Chris Lattner
46ada15d42 Introduce a new MutableArrayRef class, which refers to a series of mutable
T's that are consequtively in memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148463 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 06:34:52 +00:00
Evan Cheng
a2e435cd23 Enhance finalizeBundle to return end of bundle iterator because it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148462 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 06:13:10 +00:00
Lang Hames
c2220057c0 Added methods to get the live range immediately before a given slot. Intended to parallel the getVNInfoBefore method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148453 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 01:36:06 +00:00
Evan Cheng
bca15f9c80 - Slight change to finalizeBundle() interface. LastMI is not exclusive (pointing
to instruction right after the last instruction in the bundle.
- Add a finalizeBundle() variant that doesn't specify LastMI. Instead, the code
  will find the last instruction in the bundle by following the 'InsideBundle'
  marker. This is useful in case bundles are formed early (i.e. during MI
  scheduling) but finalized later (i.e. after register allocator has finished
  rewriting virtual registers with physical registers).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148444 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 00:46:06 +00:00
Nick Lewycky
22de16dc75 Add a TargetOption for disabling tail calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148442 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 00:34:10 +00:00
Evan Cheng
9b159710eb Rename Finalizebundle to finalizeBundle to conform to coding guideline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148440 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 00:06:10 +00:00
Jakob Stoklund Olesen
9cf37e8b48 Add a RegisterMaskSDNode class.
This SelectionDAG node will be attached to call nodes by LowerCall(),
and eventually becomes a MO_RegisterMask MachineOperand on the
MachineInstr representing the call instruction.

LowerCall() will attach a register mask that depends on the calling
convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18 23:52:12 +00:00
Rafael Espindola
8887a0f341 Add support for the gnueabihf environment. Patch by Sylvestre Ledru.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148434 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18 23:35:29 +00:00
Nadav Rotem
a402271351 Document the fact that the selection dag changes the vselect condition type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148411 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18 20:50:30 +00:00
Jim Grosbach
ec3433852d Tidy up. MCAsmBackend naming conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148400 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18 18:52:16 +00:00
Jim Grosbach
9b5b125c34 Move some ARM specific MCAssmebler bits into the ARMAsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148364 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18 00:23:57 +00:00
Jakob Stoklund Olesen
31867660cb Add a CoveredBySubRegs property to Register descriptions.
When set, this bit indicates that a register is completely defined by
the value of its sub-registers.

Use the CoveredBySubRegs property to infer which super-registers are
call-preserved given a list of callee-saved registers.  For example, the
ARM registers D8-D15 are callee-saved.  This now automatically implies
that Q4-Q7 are call-preserved.

Conversely, Win64 callees save XMM6-XMM15, but the corresponding
YMM6-YMM15 registers are not call-preserved because they are not fully
defined by their sub-registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148363 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18 00:16:39 +00:00
Jakub Staszak
0271dadee4 Remove unneeded include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148360 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 23:53:08 +00:00
Jakob Stoklund Olesen
ec572539dd Add TableGen support for callee saved registers.
Targets can now add CalleeSavedRegs defs to their *CallingConv.td file.
TableGen will use this to create a *_SaveList array suitable for
returning from getCalleeSavedRegs() as well as a *_RegMask bit mask
suitable for returning from getCallPreservedMask().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148346 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 22:46:58 +00:00
Jakub Staszak
bda43e95a0 Move includes to the .cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148342 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 22:16:31 +00:00
Jakub Staszak
fced294599 Trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148332 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 20:58:08 +00:00
Dan Gohman
2f6263c96a Add a new ObjC ARC optimization pass to eliminate unneeded
autorelease push+pop pairs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148330 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 20:52:24 +00:00
Dan Gohman
7d4c87ef6e Add a new PassManagerBuilder customization point,
EP_ModuleOptimizerEarly, to allow passes to be added before the
main ModulePass optimizers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148329 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 20:51:32 +00:00
Manuel Klimek
44b920fac4 Removes template magic to build up containers.
Instead, we now put the attributes of the container into members.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148302 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 09:34:07 +00:00
Andrew Trick
42b7a71dc7 Renamed MachineScheduler to ScheduleTopDownLive.
Responding to code review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148290 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 06:55:03 +00:00
Andrew Trick
c1b1c7b205 Moving options declarations around.
More short term hackery until we have a way to configure passes that work on LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148289 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 06:54:59 +00:00
Chris Lattner
1752e45de9 add some missing const qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148274 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 01:31:32 +00:00
Jakob Stoklund Olesen
ff5bad0787 Add portable bit mask operations to BitVector.
BitVector uses the native word size for its internal representation.
That doesn't work well for literal bit masks in source code.

This patch adds BitVector operations to efficiently apply literal bit
masks specified as arrays of uint32_t.  Since each array entry always
holds exactly 32 bits, these portable bit masks can be source code
literals, probably produced by TableGen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148272 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 01:24:32 +00:00
Jim Grosbach
020f4e861a ExecutionEngine interface to re-map addresses for engines that support it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148264 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-16 23:50:55 +00:00
Jakob Stoklund Olesen
c035c940a6 Extract method for detecting constant unallocatable physregs.
It is safe to move uses of such registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148259 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-16 22:34:08 +00:00
Jim Grosbach
61425c0a7f MCJIT support for non-function sections.
Move to a by-section allocation and relocation scheme. This allows
better support for sections which do not contain externally visible
symbols.

Flesh out the relocation address vs. local storage address separation a
bit more as well. Remote process JITs use this to tell the relocation
resolution code where the code will live when it executes.

The startFunctionBody/endFunctionBody interfaces to the JIT and the
memory manager are deprecated. They'll stick around for as long as the
old JIT does, but the MCJIT doesn't use them anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148258 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-16 22:26:39 +00:00
Jakob Stoklund Olesen
7739cad69d Add a new kind of MachineOperand: MO_RegisterMask.
Register masks will be used as a compact representation of large clobber
lists.  Currently, an x86 call instruction has some 40 operands
representing call-clobbered registers.  That's more than 1kB of useless
operands per call site.

A register mask operand references a bit mask of call-preserved
registers, everything else is clobbered.  The bit mask will typically
come from TargetRegisterInfo::getCallPreservedMask().

By abandoning ImplicitDefs for call-clobbered registers, it also becomes
possible to share call instruction descriptions between calling
conventions, and we can get rid of the WINCALL* instructions.

This patch introduces the new operand kind.  Future patches will add
RegMask support to target-independent passes before finally the fixed
clobber lists can be removed from call instruction descriptions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148250 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-16 19:22:00 +00:00
Benjamin Kramer
ed4c8c633c Return an ArrayRef from ShuffleVectorSDNode::getMask and push it through CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148218 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-15 13:16:05 +00:00
Chandler Carruth
4aab4ab340 Remove SetWorkingDirectory from the Process interface. Nothing in LLVM
or Clang is using this, and it would be hard to use it correctly given
the thread hostility of the function. Also, it never checked the return
which is rather dangerous with chdir. If someone was in fact using this,
please let me know, as well as what the usecase actually is so that
I can add it back and make it more correct and secure to use. (That
said, it's never going to be "safe" per-se, but we could at least
document the risks...)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148211 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-15 08:41:35 +00:00
Jakob Stoklund Olesen
bd6dc3be1d Add TRI::getCallPreservedMask() hook.
The hook returns a bit-mask of call-preserved registers that will
eventually replace the current list of implicit defs on call
instructions.  This will make it possible to support multiple calling
conventions without duplicating call instruction descriptors.

The call-preserved mask is slightly different from the list returned by
the getCalleeSavedRegs() hook, it includes all aliases that are
preserved by calls.

The hook takes a CallingConv::ID argument instead of a MachineFunction
pointer, so it can provide information about calls to extern functions,
and even indirect function calls.

TRI::getCalleeSavedRegs() returns information about the function
currently being compiled. TRI::getCallPreservedMask() returns
information about the functions it is calling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148165 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14 01:45:25 +00:00
Pete Cooper
0f3023c180 Fixed comment. Thanks Duncan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148123 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13 17:52:01 +00:00
Andrew Trick
96f678f2d7 Added the MachineSchedulerPass skeleton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148105 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13 06:30:30 +00:00