Commit Graph

15267 Commits

Author SHA1 Message Date
Jim Grosbach
a21bb20f59 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 18:35:03 +00:00
Jim Grosbach
ebd4c05c3c Better diagnostic for malformed .org assembly directive.
Provide source line number information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149101 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 00:37:08 +00:00
Jim Grosbach
82f4ce5081 Add simple support for keeping MCFixup source information.
Can be used to issue more user friendly diagnostics for faulty
relocation constructs and such.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:20:11 +00:00
Jim Grosbach
3662e5ce70 Add SourceMgr to MCContext for backend diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:20:05 +00:00
Chris Lattner
6b0dc92043 progress making the world safe to ConstantDataVector. While
we're at it, allow PatternMatch's "neg" pattern to match integer
vector negations, and enhance ComputeNumSigned bits to handle
shl of vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149082 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 21:37:55 +00:00
Chris Lattner
5b676ce793 tidy up forward declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149078 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 20:44:57 +00:00
Jakob Stoklund Olesen
1a96c91431 Clear kill flags before propagating a copy.
The live range of the source register may be extended when a redundant
copy is eliminated. Make sure any kill flags between the two copies are
cleared.

This fixes PR11765.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149069 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 17:52:15 +00:00
James Molloy
34982576a4 Add support for the R_ARM_TARGET1 relocation, which should be given to relocations applied to all C++ constructors and destructors.
This enables the linker to match concrete relocation types (absolute or relative) with whatever library or C++ support code is being linked against.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149057 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 09:25:43 +00:00
Chris Lattner
56243b89e7 eliminate the Constant::getVectorElements method. There are better (and
more robust) ways to do what it was doing now.  Also, add static methods
for decoding a ShuffleVector mask.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149028 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 02:51:13 +00:00
Chris Lattner
e150e2df42 Add a ConstantDataVector::getSplatValue() method, for parity with
ConstantVector.  Fix some outright bugs in the implementation of
ConstantArray and Constant struct, which would cause us to not make
one big UndefValue when asking for an array/struct with all undef
elements.  Enhance Constant::isAllOnesValue to work with
ConstantDataVector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149021 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 02:31:22 +00:00
Chris Lattner
27984e67f7 add StructType helpers too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 00:06:44 +00:00
Chris Lattner
6e3abaa77f Ok, break down and add some cast<>'ing helper methods to the Type class
to reduce the number of cast<>'s we have.  This allows someone to use
things like Ty->getVectorNumElements() instead of 
cast<VectorType>(Ty)->getNumElements() when you know that a type is a
vector.

It would be a great general cleanup to move the codebase to use these,
I will do so in the code I'm touching.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148999 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 00:01:10 +00:00
Chris Lattner
83694a984c add some helper methods to ShuffleVectorInst and enhance its
"isValidOperands" and "getMaskValue" methods to allow 
ConstantDataSequential.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 23:49:49 +00:00
Anton Korobeynikov
4a99f59aef Properly emit ctors / dtors with priorities into desired sections
and let linker handle the rest.

This finally fixes PR5329



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148990 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 22:24:19 +00:00
Chandler Carruth
8f7fe08fee Revert a tiny bit of r148553 which extended LLVM's function attributes
to 64-bits, and added a new attribute in bit #32. Specifically, remove
this new attribute from the enum used in the C API. It's not yet clear
what the best approach is for exposing these new attributes in the
C API, and several different proposals are on the table. Until then, we
can simply not expose this bit in the API at all.

Also, I've reverted a somewhat unrelated change in the same revision
which switched from "1 << 31" to "1U << 31" for the top enum. While "1
<< 31" is technically undefined behavior, implementations DTRT here.
However, MS and -pedantic mode warn about non-'int' type enumerator
values. If folks feel strongly about this I can put the 'U' back in, but
it seemed best to wait for the proper solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148937 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 07:40:15 +00:00
Evan Cheng
a15c9d84de Update hasProperty comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148936 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 07:38:48 +00:00
Chris Lattner
3d5ed2250e constify some methods and add a new Constant::getAggregateElement
helper method for the common operation of extracting an element
out of a constant aggregate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148931 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 06:16:32 +00:00
Chris Lattner
3c2c954e0b reapply r148901 with a crucial fix.
"Introduce a new ConstantVector::getSplat constructor function to 
simplify a really common case."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 05:19:54 +00:00
Craig Topper
bce73e0a8c Remove AVX 256-bit unaligned load intrinsics. 128-bit versions had been removed a while ago.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148922 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 04:42:03 +00:00
Argyrios Kyrtzidis
1ab525e857 Revert r148901 because it crashes llvm tests.
Original log:
    Introduce a new ConstantVector::getSplat constructor function to
    simplify a really common case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148906 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 02:42:41 +00:00
Chris Lattner
82385c9a40 Introduce a new ConstantVector::getSplat constructor function to
simplify a really common case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148901 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 01:53:58 +00:00
Chris Lattner
af7b4fb9be Remove the Type::getNumElements() method, which is only called in 4 places,
did something extremely surprising, and shadowed actually useful 
implementations that had completely different behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148898 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 01:32:59 +00:00
Talin
2527188a42 Additional methods for SmallString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148881 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 23:43:59 +00:00
Jakob Stoklund Olesen
5b52f6d655 Add an (interleave A, B, ...) SetTheory operator.
This will interleave the elements from two or more lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 18:06:05 +00:00
David Blaikie
b2b3d7d972 Reword comment based on feedback by Duncan Sands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148809 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 16:18:30 +00:00
Chris Lattner
3210060243 Rearrange argument order of ::get methods so that LLVMContext comes first,
add a ConstantDataArray::getString method that corresponds to the (to be
removed) StringRef version of ConstantArray::get, but is dramatically more 
efficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148804 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 14:04:40 +00:00
Chris Lattner
1ee0ecf84a add more support for ConstantDataSequential
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148802 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 13:41:11 +00:00
Chris Lattner
9e631da253 Add AsmPrinter (aka MCLowering) support for ConstantDataSequential,
and clean up some other misc stuff.  Unlike ConstantArray, we will
prefer to emit .fill directives for "String" arrays that all have
the same value, since they are denser than emitting a .ascii


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 09:31:43 +00:00
Chris Lattner
6233907312 Add various "string" methods to ConstantDataSequential, which have the
same semantics as ConstantArray's but much more efficient because they
don't have to return std::string's.  The ConstantArray methods will
eventually be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148792 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 09:01:07 +00:00
Chris Lattner
a97a5eabe2 add ::drop_back() and ::drop_front() methods, which are like pop_front/pop_back on a vector, but a) aren't destructive to "this", and b) can take a # elements to drop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148791 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 08:58:57 +00:00
Chris Lattner
df39028607 teach valuetracking about ConstantDataSequential
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148790 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 07:54:10 +00:00
Chris Lattner
a97ddd0cff Split the interesting bits of ConstantFoldLoadThroughGEPConstantExpr
out into a new ConstantFoldLoadThroughGEPIndices (more useful) function
and rewrite it to be simpler, more efficient, and to handle the new
ConstantDataSequential type.

Enhance ConstantFoldLoadFromConstPtr to handle ConstantDataSequential.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148786 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 05:43:50 +00:00
Chris Lattner
ff2b7f3cd6 Add some accessor methods to CAZ and UndefValue that help simplify clients.
Make some CDS methods public.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148785 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 05:42:11 +00:00
Chris Lattner
45bb5c5333 implement the ConstantDataSequential accessor methods.
No need for 'getOperand' :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148778 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 04:43:41 +00:00
Chandler Carruth
3eb4be0ace Revert r148686 (and r148694, a fix to it) due to a serious layering
violation -- MC cannot depend on CodeGen.

Specifically, the MCTargetDesc component of each target is actually
a subcomponent of the MC library. As such, it cannot depend on the
target-independent code generator, because MC itself cannot depend on
the target-independent code generator. This change moved a flag from the
ARM MCTargetDesc file ARMMCAsmInfo.cpp to the CodeGen layer in
ARMException.cpp, leaving behind an 'extern' to refer back to it. That
layering order isn't viable givin the constraints outlined above.
Commandline flags are designed to be static specifically to avoid these
types of bugs.

Fixing this is likely going to require some non-trivial refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148759 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 00:30:17 +00:00
David Blaikie
153c8adc49 Changing bitfield enums to unsigned ints.
This was suggested by Chandler Carruth on the basis of past experience with
esoteric compilers/quirks relating to signed enums.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 23:27:47 +00:00
Chris Lattner
27dd9cf5d1 start the implementation of a new ConstantDataVector and ConstantDataArray
classes, per PR1324.  Not all of their helper functions are implemented,
nothing creates them, and the rest of the compiler doesn't handle them yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148741 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 22:57:10 +00:00
Bill Wendling
4302a4965c Remove extraneous ';'s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148740 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 22:55:02 +00:00
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