Revision tags: llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3 |
|
#
6bda14b3 |
| 06-Jun-2017 |
Chandler Carruth <chandlerc@gmail.com> |
Sort the remaining #include lines in include/... and lib/....
I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line
Sort the remaining #include lines in include/... and lib/....
I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days.
I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch.
This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files.
Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again).
llvm-svn: 304787
show more ...
|
#
5fbdd177 |
| 31-May-2017 |
Reid Kleckner <rnk@google.com> |
[IR] Add additional addParamAttr/removeParamAttr to AttributeList API
Summary: Fairly straightforward patch to fill in some of the holes in the attributes API with respect to accessing parameter/arg
[IR] Add additional addParamAttr/removeParamAttr to AttributeList API
Summary: Fairly straightforward patch to fill in some of the holes in the attributes API with respect to accessing parameter/argument attributes. The patch aims to step further towards encapsulating the idx+FirstArgIndex pattern to access these attributes to within the AttributeList.
Patch by Daniel Neilson!
Reviewers: rnk, chandlerc, pete, javed.absar, reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33355
llvm-svn: 304329
show more ...
|
Revision tags: llvmorg-4.0.1-rc2 |
|
#
96ab8726 |
| 18-May-2017 |
Reid Kleckner <rnk@google.com> |
[IR] De-virtualize ~Value to save a vptr
Summary: Implements PR889
Removing the virtual table pointer from Value saves 1% of RSS when doing LTO of llc on Linux. The impact on time was positive, but
[IR] De-virtualize ~Value to save a vptr
Summary: Implements PR889
Removing the virtual table pointer from Value saves 1% of RSS when doing LTO of llc on Linux. The impact on time was positive, but too noisy to conclusively say that performance improved. Here is a link to the spreadsheet with the original data:
https://docs.google.com/spreadsheets/d/1F4FHir0qYnV0MEp2sYYp_BuvnJgWlWPhWOwZ6LbW7W4/edit?usp=sharing
This change makes it invalid to directly delete a Value, User, or Instruction pointer. Instead, such code can be rewritten to a null check and a call Value::deleteValue(). Value objects tend to have their lifetimes managed through iplist, so for the most part, this isn't a big deal. However, there are some places where LLVM deletes values, and those places had to be migrated to deleteValue. I have also created llvm::unique_value, which has a custom deleter, so it can be used in place of std::unique_ptr<Value>.
I had to add the "DerivedUser" Deleter escape hatch for MemorySSA, which derives from User outside of lib/IR. Code in IR cannot include MemorySSA headers or call the MemoryAccess object destructors without introducing a circular dependency, so we need some level of indirection. Unfortunately, no class derived from User may have any virtual methods, because adding a virtual method would break User::getHungOffOperands(), which assumes that it can find the use list immediately prior to the User object. I've added a static_assert to the appropriate OperandTraits templates to help people avoid this trap.
Reviewers: chandlerc, mehdi_amini, pete, dberlin, george.burgess.iv
Reviewed By: chandlerc
Subscribers: krytarowski, eraman, george.burgess.iv, mzolotukhin, Prazek, nlewycky, hans, inglorion, pcc, tejohnson, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D31261
llvm-svn: 303362
show more ...
|
#
e7c7854c |
| 11-May-2017 |
Reid Kleckner <rnk@google.com> |
De-virtualize GlobalValue
The erase/remove from parent methods now use a switch table to remove themselves from their appropriate parent ilist.
The copyAttributesFrom method is now completely non-v
De-virtualize GlobalValue
The erase/remove from parent methods now use a switch table to remove themselves from their appropriate parent ilist.
The copyAttributesFrom method is now completely non-virtual, since we only ever copy attributes from a global of the appropriate type.
Pre-requisite to de-virtualizing Value to save a vptr (https://reviews.llvm.org/D31261).
NFC
llvm-svn: 302823
show more ...
|
#
eba7e4ec |
| 10-May-2017 |
Eugene Zelenko <eugene.zelenko@gmail.com> |
[IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
llvm-svn: 302744
|
#
a0b45f4b |
| 03-May-2017 |
Reid Kleckner <rnk@google.com> |
[IR] Abstract away ArgNo+1 attribute indexing as much as possible
Summary: Do three things to help with that: - Add AttributeList::FirstArgIndex, which is an enumerator currently set to 1. It allo
[IR] Abstract away ArgNo+1 attribute indexing as much as possible
Summary: Do three things to help with that: - Add AttributeList::FirstArgIndex, which is an enumerator currently set to 1. It allows us to change the indexing scheme with fewer changes. - Add addParamAttr/removeParamAttr. This just shortens addAttribute call sites that would otherwise need to spell out FirstArgIndex. - Remove some attribute-specific getters and setters from Function that take attribute list indices. Most of these were only used from BuildLibCalls, and doesNotAlias was only used to test or set if the return value is malloc-like.
I'm happy to split the patch, but I think they are probably easier to review when taken together.
This patch should be NFC, but it sets the stage to change the indexing scheme to this, which is more convenient when indexing into an array: 0: func attrs 1: retattrs 2...: arg attrs
Reviewers: chandlerc, pete, javed.absar
Subscribers: david2050, llvm-commits
Differential Revision: https://reviews.llvm.org/D32811
llvm-svn: 302060
show more ...
|
#
ef5798ac |
| 03-May-2017 |
Elad Cohen <elad2.cohen@intel.com> |
Support arbitrary address space pointers in masked gather/scatter intrinsics.
Fixes PR31789 - When loop-vectorize tries to use these intrinsics for a non-default address space pointer we fail with a
Support arbitrary address space pointers in masked gather/scatter intrinsics.
Fixes PR31789 - When loop-vectorize tries to use these intrinsics for a non-default address space pointer we fail with a "Calling a function with a bad singature!" assertion. This patch solves this by adding the 'vector of pointers' argument as an overloaded type which will determine the address space.
Differential revision: https://reviews.llvm.org/D31490
llvm-svn: 302018
show more ...
|
#
ee4930b6 |
| 02-May-2017 |
Reid Kleckner <rnk@google.com> |
Re-land r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"
This time, I fixed, built, and tested clang.
This reverts r301712.
llvm-svn: 301981
|
#
0f88d863 |
| 28-Apr-2017 |
Hans Wennborg <hans@hanshq.net> |
Revert r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"
This broke the Clang build. (Clang-side patch missing?)
Original commit message:
> [IR] Make add/remove At
Revert r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"
This broke the Clang build. (Clang-side patch missing?)
Original commit message:
> [IR] Make add/remove Attributes use AttrBuilder instead of > AttributeList > > This change cleans up call sites and avoids creating temporary > AttributeList objects. > > NFC
llvm-svn: 301712
show more ...
|
#
608c8b63 |
| 28-Apr-2017 |
Reid Kleckner <rnk@google.com> |
[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList
This change cleans up call sites and avoids creating temporary AttributeList objects.
NFC
llvm-svn: 301697
|
#
859f8b54 |
| 28-Apr-2017 |
Reid Kleckner <rnk@google.com> |
Make getParamAlignment use argument numbers
The method is called "get *Param* Alignment", and is only used for return values exactly once, so it should take argument indices, not attribute indices.
Make getParamAlignment use argument numbers
The method is called "get *Param* Alignment", and is only used for return values exactly once, so it should take argument indices, not attribute indices.
Avoids confusing code like: IsSwiftError = CS->paramHasAttr(ArgIdx, Attribute::SwiftError); Alignment = CS->getParamAlignment(ArgIdx + 1);
Add getRetAlignment to handle the one case in Value.cpp that wants the return value alignment.
This is a potentially breaking change for out-of-tree backends that do their own call lowering.
llvm-svn: 301682
show more ...
|
#
6a752c4d |
| 28-Apr-2017 |
Reid Kleckner <rnk@google.com> |
[IR] Delete unused Argument::removeAttr overload
It doesn't make sense to remove an AttributeList from an argument.
llvm-svn: 301663
|
Revision tags: llvmorg-4.0.1-rc1 |
|
#
9d16fa09 |
| 19-Apr-2017 |
Reid Kleckner <rnk@google.com> |
Prefer addAttr(Attribute::AttrKind) over the AttributeList overload
This should simplify the call sites, which typically want to tweak one attribute at a time. It should also avoid creating ephemera
Prefer addAttr(Attribute::AttrKind) over the AttributeList overload
This should simplify the call sites, which typically want to tweak one attribute at a time. It should also avoid creating ephemeral AttributeLists that live forever.
llvm-svn: 300718
show more ...
|
#
f021fab2 |
| 13-Apr-2017 |
Reid Kleckner <rnk@google.com> |
[IR] Make getParamAttributes take argument numbers, not ArgNo+1
Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1, Kind) everywhere.
The fact that the AttributeList index for an ar
[IR] Make getParamAttributes take argument numbers, not ArgNo+1
Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1, Kind) everywhere.
The fact that the AttributeList index for an argument is ArgNo+1 should be a hidden implementation detail.
NFC
llvm-svn: 300272
show more ...
|
#
b518054b |
| 21-Mar-2017 |
Reid Kleckner <rnk@google.com> |
Rename AttributeSet to AttributeList
Summary: This class is a list of AttributeSetNodes corresponding the function prototype of a call or function declaration. This class used to be called ParamAttr
Rename AttributeSet to AttributeList
Summary: This class is a list of AttributeSetNodes corresponding the function prototype of a call or function declaration. This class used to be called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is typically accessed by parameter and return value index, so "AttributeList" seems like a more intuitive name.
Rename AttributeSetImpl to AttributeListImpl to follow suit.
It's useful to rename this class so that we can rename AttributeSetNode to AttributeSet later. AttributeSet is the set of attributes that apply to a single function, argument, or return value.
Reviewers: sanjoy, javed.absar, chandlerc, pete
Reviewed By: pete
Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits
Differential Revision: https://reviews.llvm.org/D31102
llvm-svn: 298393
show more ...
|
#
56d028d9 |
| 17-Mar-2017 |
Reid Kleckner <rnk@google.com> |
Store Arguments in a flat array instead of an iplist
This saves two pointers from Argument and eliminates some extra allocations.
Arguments cannot be inserted or removed from a Function because tha
Store Arguments in a flat array instead of an iplist
This saves two pointers from Argument and eliminates some extra allocations.
Arguments cannot be inserted or removed from a Function because that would require changing its Type, which LLVM does not allow. Instead, passes that change prototypes, like DeadArgElim, create a new Function and copy over argument names and attributes. The primary benefit of iplist is O(1) random insertion and removal. We just don't need that for arguments, so don't use it.
Reviewed By: chandlerc
Subscribers: dlj, inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D31058
llvm-svn: 298105
show more ...
|
#
c9a392b9 |
| 16-Mar-2017 |
Reid Kleckner <rnk@google.com> |
Remove dead F parameter from Argument constructor
When Function creates its argument list, it does the ilist push_back itself. No other caller passes in a parent function, so this is dead, and it us
Remove dead F parameter from Argument constructor
When Function creates its argument list, it does the ilist push_back itself. No other caller passes in a parent function, so this is dead, and it uses the soon-to-be-deleted getArgumentList accessor.
llvm-svn: 298009
show more ...
|
#
eb54909c |
| 16-Mar-2017 |
Reid Kleckner <rnk@google.com> |
Make Argument::getArgNo() constant time, not O(#args)
getArgNo is actually hot in LLVM, because its how we check for attributes on arguments: bool Argument::hasNonNullAttr() const { if (!getTy
Make Argument::getArgNo() constant time, not O(#args)
getArgNo is actually hot in LLVM, because its how we check for attributes on arguments: bool Argument::hasNonNullAttr() const { if (!getType()->isPointerTy()) return false; if (getParent()->getAttributes(). hasAttribute(getArgNo()+1, Attribute::NonNull)) return true;
It actually shows up as the 23rd hottest leaf function in a 13s sample of LTO of llc.
This grows Argument by four bytes, but I have another pending patch to shrink it by removing its ilist_node base.
Reviewed By: chandlerc
Subscribers: inglorion, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D31057
llvm-svn: 298003
show more ...
|
#
1275a2de |
| 16-Mar-2017 |
Reid Kleckner <rnk@google.com> |
[IR] Inline some Function accessors
I checked that all of these out-of-line methods previously compiled to simple loads and bittests, so they are pretty good candidates for inlining. In particular,
[IR] Inline some Function accessors
I checked that all of these out-of-line methods previously compiled to simple loads and bittests, so they are pretty good candidates for inlining. In particular, arg_size() and arg_empty() are popular and are just two loads, so they seem worth inlining.
llvm-svn: 297963
show more ...
|
Revision tags: llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3 |
|
#
a60cdd38 |
| 28-Feb-2017 |
Dehao Chen <dehao@google.com> |
Add function importing info from samplepgo profile to the module summary.
Summary: For SamplePGO, the profile may contain cross-module inline stacks. As we need to make sure the profile annotation h
Add function importing info from samplepgo profile to the module summary.
Summary: For SamplePGO, the profile may contain cross-module inline stacks. As we need to make sure the profile annotation happens when all the hot inline stacks are expanded, we need to pass this info to the module importer so that it can import proper functions if necessary. This patch implemented this feature by emitting cross-module targets as part of function entry metadata. In the module-summary phase, the metadata is used to build call edges that points to functions need to be imported.
Reviewers: mehdi_amini, tejohnson
Reviewed By: tejohnson
Subscribers: davidxl, llvm-commits
Differential Revision: https://reviews.llvm.org/D30053
llvm-svn: 296498
show more ...
|
#
3c1432fe |
| 15-Feb-2017 |
Daniel Berlin <dberlin@dberlin.org> |
Implement intrinsic mangling for literal struct types. Fixes PR 31921
Summary: Predicateinfo requires an ugly workaround to try to avoid literal struct types due to the intrinsic mangling not being
Implement intrinsic mangling for literal struct types. Fixes PR 31921
Summary: Predicateinfo requires an ugly workaround to try to avoid literal struct types due to the intrinsic mangling not being implemented. This workaround actually does not work in all cases (you can hit the assert by bootstrapping with -print-predicateinfo), and can't be made to work without DFS'ing the type (IE copying getMangledStr and using a version that detects if it would crash).
Rather than do that, i just implemented the mangling. It seems simple, since they are unified structurally.
Looking at the overloaded-mangling testcase we have, it actually turns out the gc intrinsics will *also* crash if you try to use a literal struct. Thus, the testcase added fails before this patch, and works after, without needing to resort to predicateinfo.
Reviewers: chandlerc, davide
Subscribers: llvm-commits, sanjoy
Differential Revision: https://reviews.llvm.org/D29925
llvm-svn: 295253
show more ...
|
#
a109dd13 |
| 14-Feb-2017 |
Sanjay Patel <spatel@rotateright.com> |
fix documentation comments for Argument; NFC
llvm-svn: 295068
|
Revision tags: llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1 |
|
#
291abd3e |
| 28-Dec-2016 |
Justin Lebar <jlebar@google.com> |
Speed up Function::isIntrinsic() by adding a bit to GlobalValue. NFC
Summary: Previously isIntrinsic() called getName(). This involves a hashtable lookup, so is nontrivially expensive. And isIntri
Speed up Function::isIntrinsic() by adding a bit to GlobalValue. NFC
Summary: Previously isIntrinsic() called getName(). This involves a hashtable lookup, so is nontrivially expensive. And isIntrinsic() is called frequently, particularly by dyn_cast<IntrinsicInstr>.
This patch steals a bit of IntID and uses that to store whether or not getName() starts with "llvm."
Reviewers: bogner, arsenm, joker-eph
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D22949
llvm-svn: 290691
show more ...
|
Revision tags: llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1 |
|
#
caaceef4 |
| 03-Nov-2016 |
Elena Demikhovsky <elena.demikhovsky@intel.com> |
Expandload and Compressstore intrinsics
2 new intrinsics covering AVX-512 compress/expand functionality. This implementation includes syntax, DAG builder, operation lowering and tests. Does not incl
Expandload and Compressstore intrinsics
2 new intrinsics covering AVX-512 compress/expand functionality. This implementation includes syntax, DAG builder, operation lowering and tests. Does not include: handling of illegal data types, codegen prepare pass and the cost model.
llvm-svn: 285876
show more ...
|
#
ca7664e7 |
| 25-Oct-2016 |
Peter Collingbourne <peter@pcc.me.uk> |
IR: Deduplicate getParent() functions on derived classes of GlobalValue into the base class. NFCI.
llvm-svn: 285050
|