Commit Graph

4495 Commits

Author SHA1 Message Date
David Blaikie
78c796e203 Include all the fields so we can correctly emit DW_TAG_structure_type for C++ structs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167334 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02 23:33:23 +00:00
Duncan Sands
9825d1edf0 Enable the assertion in getIntPtrType (I've audited all users of this method and
they are now all correct; hopefully the buildbots will agree!).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167289 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02 09:02:37 +00:00
Chandler Carruth
1521406a4b Remove a weird static helper from the GEP instruction and just directly
compute the address space in the one place it was used.

Also write the getPointerAddressSpace member in terms of the
getPointerOperandType member.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01 10:59:30 +00:00
Chandler Carruth
8fb614cb3b Teach Type::getPointerAddressSpace to look through pointer vectors
politely and document this feature.

This simple API extension then allows us to write all of the
Instructions' address space query methods much more simply. No
functionality change intended here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167223 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01 09:37:49 +00:00
Chandler Carruth
ece6c6bb63 Revert the series of commits starting with r166578 which introduced the
getIntPtrType support for multiple address spaces via a pointer type,
and also introduced a crasher bug in the constant folder reported in
PR14233.

These commits also contained several problems that should really be
addressed before they are re-committed. I have avoided reverting various
cleanups to the DataLayout APIs that are reasonable to have moving
forward in order to reduce the amount of churn, and minimize the number
of commits that were reverted. I've also manually updated merge
conflicts and manually arranged for the getIntPtrType function to stay
in DataLayout and to be defined in a plausible way after this revert.

Thanks to Duncan for working through this exact strategy with me, and
Nick Lewycky for tracking down the really annoying crasher this
triggered. (Test case to follow in its own commit.)

After discussing with Duncan extensively, and based on a note from
Micah, I'm going to continue to back out some more of the more
problematic patches in this series in order to ensure we go into the
LLVM 3.2 branch with a reasonable story here. I'll send a note to
llvmdev explaining what's going on and why.

Summary of reverted revisions:

r166634: Fix a compiler warning with an unused variable.
r166607: Add some cleanup to the DataLayout changes requested by
         Chandler.
r166596: Revert "Back out r166591, not sure why this made it through
         since I cancelled the command. Bleh, sorry about this!
r166591: Delete a directory that wasn't supposed to be checked in yet.
r166578: Add in support for getIntPtrType to get the pointer type based
         on the address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167221 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01 08:07:29 +00:00
Quentin Colombet
9a419f656e Change ForceSizeOpt attribute into MinSize attribute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167020 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 16:32:52 +00:00
Duncan Sands
446cf94cdb Fix isEliminableCastPair to work correctly in the presence of pointers
with different sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167018 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 16:03:32 +00:00
Duncan Sands
7adfe3fd60 Add a helper for telling whether a type is a pointer or vector of pointer type.
Simplify the implementation of the corresponding integer and float functions and
move them inline while there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167014 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 13:38:54 +00:00
Ulrich Weigand
3467b9fd5d Enable some additional constant folding for PPCDoubleDouble.
This fixes Clang :: CodeGen/complex-builtints.c on PowerPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 12:33:18 +00:00
Duncan Sands
7ed4f94c13 Remove a wrapper around getIntPtrType added to GVN by Hal in commit 166624 (the
wrapper returns a vector of integers when passed a vector of pointers) by having
getIntPtrType itself return a vector of integers in this case.  Outside of this
wrapper, I didn't find anywhere in the codebase that was relying on the old
behaviour for vectors of pointers, so give this a whirl through the buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166939 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 17:31:46 +00:00
Duncan Sands
edece78550 Factorize code: rather than duplication the logic in getPointerTypeSizeInBits,
just call getPointerTypeSizeInBits.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166926 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 14:30:05 +00:00
Benjamin Kramer
276c43f022 Lowercase the argument for TargetTransformInfo so it's consistent with all other passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166794 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 18:46:15 +00:00
Joerg Sonnenberger
475832cc0f Don't explicitly require RTTI and EH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166772 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 12:15:29 +00:00
Micah Villmow
b52fb87617 Add some cleanup to the DataLayout changes requested by Chandler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166607 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 18:36:13 +00:00
Micah Villmow
b8bce928f4 Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166596 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 17:25:11 +00:00
Micah Villmow
2f87640b86 Delete a directory that wasn't supposed to be checked in yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166591 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 17:20:04 +00:00
Micah Villmow
aa76e9e2cf Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the
clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166578 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 15:52:52 +00:00
Elena Demikhovsky
3575222175 Special calling conventions for Intel OpenCL built-in library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166566 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 14:46:16 +00:00
Richard Smith
30f57da439 Fix ODR violations: a virtual function must be defined, even if it's never
called. Provide an (asserting) definition of Operator's private destructor.
Remove destructors from all classes derived from Operator. We don't need them
for safety, because their implicit definitions would be ill-formed (they'd call
Operator's private destructor), and we don't need them to avoid emitting
vtables, because we don't do anything with Operator subclasses which would
trigger vtable instantiation.

The Operator hierarchy is still a complete disaster with regard to undefined
behavior, but this at least allows LLVM to link when using Clang's
-fcatch-undefined-behavior with a new vptr-based type checking mechanism.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166530 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 00:30:41 +00:00
Nadav Rotem
c97410eed2 Add a comment which explains why the assert fired and how to fix it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166467 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23 04:35:40 +00:00
Nadav Rotem
e743942bc8 Add the "ForceSizeOpt" attribute.
Patch by Quentin Colombet <qcolombet@apple.com>

Original description:
"""
The attached patch is the first step to have a better control on Oz related optimizations.
The Oz optimization level focuses on code size, thus I propose to add an attribute called ForceSizeOpt.
"""



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166422 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-22 17:33:31 +00:00
Hal Finkel
3d39fb8a3f DataLayout should use itself when calculating the size of a vector.
This is important for vectors of pointers because only DataLayout,
not the underlying vector type, knows how to calculate the size
of the pointers in the vector. Fixes PR14138.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166401 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-21 20:38:03 +00:00
Nadav Rotem
cbd9a19b5d Reapply the TargerTransformInfo changes, minus the changes to LSR and Lowerinvoke.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166248 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18 23:22:48 +00:00
Bob Wilson
3b9a911efc Temporarily revert the TargetTransform changes.
The TargetTransform changes are breaking LTO bootstraps of clang.  I am
working with Nadav to figure out the problem, but I am reverting it for now
to get our buildbots working.

This reverts svn commits: 165665 165669 165670 165786 165787 165997
and I have also reverted clang svn 165741

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166168 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18 05:43:52 +00:00
Bill Wendling
6ebddd2d65 Revert r166157 because some tests fail...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166159 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17 23:56:05 +00:00
Bill Wendling
73f75cf200 Check that the operand of the GEP is not the GEP itself. This occurred during an LTO build of LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166157 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17 23:54:19 +00:00
Bill Wendling
f3d1500ab2 Cleanup whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166016 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 06:10:45 +00:00
Bill Wendling
778986856c Cleanup whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 06:01:44 +00:00
Bill Wendling
925bcb132a Have AttributesImpl defriend the Attributes class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166012 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 05:57:28 +00:00
Bill Wendling
a5c699d5f7 Have AttrBuilder defriend the Attributes class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166011 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 05:55:09 +00:00
Bill Wendling
76b67df11e Put simple c'tors inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166008 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 05:22:28 +00:00
Bill Wendling
702cc91aa1 Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165960 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 20:35:56 +00:00
Bill Wendling
07aae2e7d5 Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 07:29:08 +00:00
Bill Wendling
ad4643f54b Use a ::get method to create the attribute from Attributes::AttrVals instead of a constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165923 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 06:53:28 +00:00
Bill Wendling
05cc40d20c Move the AttributesImpl header file into the VMCore directory so that it can be opaque.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 05:40:12 +00:00
Bill Wendling
cb3de0bc80 Attributes Rewrite
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 04:46:55 +00:00
Bill Wendling
e82a040ee0 Remove dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165902 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 09:21:44 +00:00
Bill Wendling
7be7848e17 Remove operator cast method in favor of querying with the correct method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165899 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 08:54:26 +00:00
Benjamin Kramer
fd8d62c0b4 Fix use after free when deleting attributes in a chained folding set.
Can't follow the intrusive linked list when the element is gone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165898 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 08:48:40 +00:00
Bill Wendling
2492a38afc Don't use the new syntax just yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165897 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 08:25:35 +00:00
Bill Wendling
1feacad0ca Remove the bitwise AND operators from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165896 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 07:52:48 +00:00
Bill Wendling
c416795fea Remove the bitwise assignment OR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165895 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 07:35:59 +00:00
Bill Wendling
432e606cf1 Remove the bitwise OR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165894 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 07:17:34 +00:00
Bill Wendling
3756e70af6 Remove the bitwise XOR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165893 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 06:56:13 +00:00
Bill Wendling
5886b7bfc8 Remove the bitwise NOT operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 06:39:53 +00:00
Bill Wendling
a19a53065f Decode the LLVM attributes from bitcode using the attributes builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165891 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 04:10:01 +00:00
Bill Wendling
da3f9d8edc Use builder to create alignment attributes. Remove dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 03:58:29 +00:00
Bill Wendling
96a2794ab0 Add the LLVM context to this c'tor. It will be needed in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 01:10:00 +00:00
Bill Wendling
3183951d88 Support a common idiom on how to build an Attributes class with a single attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165686 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 01:05:52 +00:00
Nadav Rotem
e3d0e86919 Add a new interface to allow IR-level passes to access codegen-specific information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165665 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 22:04:55 +00:00