#
bff5d0d1 |
| 13-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove all uses of 'using std::error_code' from headers.
llvm-svn: 210866
|
#
25188c95 |
| 12-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't import error_category into the llvm namespace.
llvm-svn: 210733
|
#
f5d07fa5 |
| 10-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Mark a few functions noexcept.
This reduces the difference between std::error_code and llvm::error_code.
llvm-svn: 210591
|
#
42a4c9f9 |
| 06-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Allow aliases to be unnamed_addr.
Alias with unnamed_addr were in a strange state. It is stored in GlobalValue, the language reference talks about "unnamed_addr aliases" but the verifier was rejecti
Allow aliases to be unnamed_addr.
Alias with unnamed_addr were in a strange state. It is stored in GlobalValue, the language reference talks about "unnamed_addr aliases" but the verifier was rejecting them.
It seems natural to allow unnamed_addr in aliases:
* It is a property of how it is accessed, not of the data itself. * It is perfectly possible to write code that depends on the address of an alias.
This patch then makes unname_addr legal for aliases. One side effect is that the syntax changes for a corner case: In globals, unnamed_addr is now printed before the address space.
llvm-svn: 210302
show more ...
|
#
44cb65ff |
| 05-Jun-2014 |
Tom Roeder <tmroeder@google.com> |
Add a new attribute called 'jumptable' that creates jump-instruction tables for functions marked with this attribute. It includes a pass that rewrites all indirect calls to jumptable functions to pas
Add a new attribute called 'jumptable' that creates jump-instruction tables for functions marked with this attribute. It includes a pass that rewrites all indirect calls to jumptable functions to pass through these tables.
This also adds backend support for generating the jump-instruction tables on ARM and X86. Note that since the jumptable attribute creates a second function pointer for a function, any function marked with jumptable must also be marked with unnamed_addr.
llvm-svn: 210280
show more ...
|
#
4dc5dfc5 |
| 04-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Clauses in a landingpad are always Constant. Use a stricter type.
llvm-svn: 210203
|
#
64c1e180 |
| 03-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Allow alias to point to an arbitrary ConstantExpr.
This patch changes GlobalAlias to point to an arbitrary ConstantExpr and it is up to MC (or the system assembler) to decide if that expression is
Allow alias to point to an arbitrary ConstantExpr.
This patch changes GlobalAlias to point to an arbitrary ConstantExpr and it is up to MC (or the system assembler) to decide if that expression is valid or not.
This reduces our ability to diagnose invalid uses and how early we can spot them, but it also lets us do things like
@test5 = alias inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32), i32 ptrtoint (i32* @bar to i32)) to i32*)
An important implication of this patch is that the notion of aliased global doesn't exist any more. The alias has to encode the information needed to access it in its metadata (linkage, visibility, type, etc).
Another consequence to notice is that getSection has to return a "const char *". It could return a NullTerminatedStringRef if there was such a thing, but when that was proposed the decision was to just uses "const char*" for that.
llvm-svn: 210062
show more ...
|
#
03bddfee |
| 31-May-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use error_code() instead of error_code::succes()
There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code.
llvm-svn: 209952
|
#
59f7eba2 |
| 28-May-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
[pr19844] Add thread local mode to aliases.
This matches gcc's behavior. It also seems natural given that aliases contain other properties that govern how it is accessed (linkage, visibility, dll st
[pr19844] Add thread local mode to aliases.
This matches gcc's behavior. It also seems natural given that aliases contain other properties that govern how it is accessed (linkage, visibility, dll storage).
Clang still has to be updated to expose this feature to C.
llvm-svn: 209759
show more ...
|
#
d52b1528 |
| 20-May-2014 |
Nick Lewycky <nicholas@mxc.ca> |
Add 'nonnull', a new parameter and return attribute which indicates that the pointer is not null. Instcombine will elide comparisons between these and null. Patch by Luqman Aden!
llvm-svn: 209185
|
#
f1bedd37 |
| 17-May-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use create methods since msvc doesn't handle delegating constructors.
llvm-svn: 209076
|
#
83705658 |
| 17-May-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Reduce abuse of default values in the GlobalAlias constructor.
This is in preparation for adding an optional offset.
llvm-svn: 209073
|
Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1 |
|
#
fceb76f5 |
| 16-May-2014 |
Reid Kleckner <reid@kleckner.net> |
Add comdat key field to llvm.global_ctors and llvm.global_dtors
This allows us to put dynamic initializers for weak data into the same comdat group as the data being initialized. This is necessary
Add comdat key field to llvm.global_ctors and llvm.global_dtors
This allows us to put dynamic initializers for weak data into the same comdat group as the data being initialized. This is necessary for MSVC ABI compatibility. Once we have comdats for guard variables, we can use the combination to help GlobalOpt fire more often for weak data with guarded initialization on other platforms.
Reviewers: nlewycky
Differential Revision: http://reviews.llvm.org/D3499
llvm-svn: 209015
show more ...
|
#
6b238633 |
| 16-May-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Fix most of PR10367.
This patch changes the design of GlobalAlias so that it doesn't take a ConstantExpr anymore. It now points directly to a GlobalObject, but its type is independent of the aliasee
Fix most of PR10367.
This patch changes the design of GlobalAlias so that it doesn't take a ConstantExpr anymore. It now points directly to a GlobalObject, but its type is independent of the aliasee type.
To avoid changing all alias related tests in this patches, I kept the common syntax
@foo = alias i32* @bar
to mean the same as now. The cases that used to use cast now use the more general syntax
@foo = alias i16, i32* @bar.
Note that GlobalAlias now behaves a bit more like GlobalVariable. We know that its type is always a pointer, so we omit the '*'.
For the bitcode, a nice surprise is that we were writing both identical types already, so the format change is minimal. Auto upgrade is handled by looking through the casts and no new fields are needed for now. New bitcode will simply have different types for Alias and Aliasee.
One last interesting point in the patch is that replaceAllUsesWith becomes smart enough to avoid putting a ConstantExpr in the aliasee. This seems better than checking and updating every caller.
A followup patch will delete getAliasedGlobal now that it is redundant. Another patch will add support for an explicit offset.
llvm-svn: 209007
show more ...
|
#
a8004457 |
| 16-May-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Small dyn_cast and auto cleanup.
llvm-svn: 208993
|
#
4fe0094f |
| 16-May-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Change the GlobalAlias constructor to look a bit more like GlobalVariable.
This is part of the fix for pr10367. A GlobalAlias always has a pointer type, so just have the constructor build the type.
Change the GlobalAlias constructor to look a bit more like GlobalVariable.
This is part of the fix for pr10367. A GlobalAlias always has a pointer type, so just have the constructor build the type.
llvm-svn: 208983
show more ...
|
#
b80de101 |
| 07-May-2014 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
IR: Don't allow non-default visibility on local linkage
Visibilities of `hidden` and `protected` are meaningless for symbols with local linkage.
- Change the assembler to reject non-default visib
IR: Don't allow non-default visibility on local linkage
Visibilities of `hidden` and `protected` are meaningless for symbols with local linkage.
- Change the assembler to reject non-default visibility on symbols with local linkage.
- Change the bitcode reader to auto-upgrade `hidden` and `protected` to `default` when the linkage is local.
- Update LangRef.
<rdar://problem/16141113>
llvm-svn: 208263
show more ...
|
#
1f10c5ea |
| 01-May-2014 |
Michael J. Spencer <bigcheesegs@gmail.com> |
[IR] Make {extract,insert}element accept an index of any integer type.
Given the following C code llvm currently generates suboptimal code for x86-64:
__m128 bss4( const __m128 *ptr, size_t i, size
[IR] Make {extract,insert}element accept an index of any integer type.
Given the following C code llvm currently generates suboptimal code for x86-64:
__m128 bss4( const __m128 *ptr, size_t i, size_t j ) { float f = ptr[i][j]; return (__m128) { f, f, f, f }; }
=================================================
define <4 x float> @_Z4bss4PKDv4_fmm(<4 x float>* nocapture readonly %ptr, i64 %i, i64 %j) #0 { %a1 = getelementptr inbounds <4 x float>* %ptr, i64 %i %a2 = load <4 x float>* %a1, align 16, !tbaa !1 %a3 = trunc i64 %j to i32 %a4 = extractelement <4 x float> %a2, i32 %a3 %a5 = insertelement <4 x float> undef, float %a4, i32 0 %a6 = insertelement <4 x float> %a5, float %a4, i32 1 %a7 = insertelement <4 x float> %a6, float %a4, i32 2 %a8 = insertelement <4 x float> %a7, float %a4, i32 3 ret <4 x float> %a8 }
=================================================
shlq $4, %rsi addq %rdi, %rsi movslq %edx, %rax vbroadcastss (%rsi,%rax,4), %xmm0 retq
=================================================
The movslq is uneeded, but is present because of the trunc to i32 and then sext back to i64 that the backend adds for vbroadcastss.
We can't remove it because it changes the meaning. The IR that clang generates is already suboptimal. What clang really should emit is:
%a4 = extractelement <4 x float> %a2, i64 %j
This patch makes that legal. A separate patch will teach clang to do it.
Differential Revision: http://reviews.llvm.org/D3519
llvm-svn: 207801
show more ...
|
Revision tags: llvmorg-3.4.1, llvmorg-3.4.1-rc2 |
|
#
5772b777 |
| 24-Apr-2014 |
Reid Kleckner <reid@kleckner.net> |
Add 'musttail' marker to call instructions
This is similar to the 'tail' marker, except that it guarantees that tail call optimization will occur. It also comes with convervative IR verification ru
Add 'musttail' marker to call instructions
This is similar to the 'tail' marker, except that it guarantees that tail call optimization will occur. It also comes with convervative IR verification rules that ensure that tail call optimization is possible.
Reviewers: nicholas
Differential Revision: http://llvm-reviews.chandlerc.com/D3240
llvm-svn: 207143
show more ...
|
#
2617dcce |
| 15-Apr-2014 |
Craig Topper <craig.topper@gmail.com> |
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206252
|
Revision tags: llvmorg-3.4.1-rc1 |
|
#
82540e9e |
| 27-Mar-2014 |
Karthik Bhat <kv.bhat@samsung.com> |
All new elements except the last one initialized to NULL. Ideally, once parsing is complete, all elements should be non-NULL. To safe-guard BitcodeReader, this patch adds null check for all access to
All new elements except the last one initialized to NULL. Ideally, once parsing is complete, all elements should be non-NULL. To safe-guard BitcodeReader, this patch adds null check for all access to these list. Patch by Dinesh Dwivedi!
llvm-svn: 204920
show more ...
|
#
e3bfdc4e |
| 15-Mar-2014 |
Justin Bogner <mail@justinbogner.com> |
Support: Make error_category's constructor public
Since our error_category is based on the std one, we should have the same visibility for the constructor. This also allows us to avoid using the _d
Support: Make error_category's constructor public
Since our error_category is based on the std one, we should have the same visibility for the constructor. This also allows us to avoid using the _do_message implementation detail in our own categories.
llvm-svn: 203998
show more ...
|
#
2fb5bc33 |
| 13-Mar-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove the linker_private and linker_private_weak linkages.
These linkages were introduced some time ago, but it was never very clear what exactly their semantics were or what they should be used fo
Remove the linker_private and linker_private_weak linkages.
These linkages were introduced some time ago, but it was never very clear what exactly their semantics were or what they should be used for. Some investigation found these uses:
* utf-16 strings in clang. * non-unnamed_addr strings produced by the sanitizers.
It turns out they were just working around a more fundamental problem. For some sections a MachO linker needs a symbol in order to split the section into atoms, and llvm had no idea that was the case. I fixed that in r201700 and it is now safe to use the private linkage. When the object ends up in a section that requires symbols, llvm will use a 'l' prefix instead of a 'L' prefix and things just work.
With that, these linkages were already dead, but there was a potential future user in the objc metadata information. I am still looking at CGObjcMac.cpp, but at this point I am convinced that linker_private and linker_private_weak are not what they need.
The objc uses are currently split in
* Regular symbols (no '\01' prefix). LLVM already directly provides whatever semantics they need. * Uses of a private name (start with "\01L" or "\01l") and private linkage. We can drop the "\01L" and "\01l" prefixes as soon as llvm agrees with clang on L being ok or not for a given section. I have two patches in code review for this. * Uses of private name and weak linkage.
The last case is the one that one could think would fit one of these linkages. That is not the case. The semantics are
* the linker will merge these symbol by *name*. * the linker will hide them in the final DSO.
Given that the merging is done by name, any of the private (or internal) linkages would be a bad match. They allow llvm to rename the symbols, and that is really not what we want. From the llvm point of view, these objects should really be (linkonce|weak)(_odr)?.
For now, just keeping the "\01l" prefix is probably the best for these symbols. If we one day want to have a more direct support in llvm, IMHO what we should add is not a linkage, it is just a hidden_symbol attribute. It would be applicable to multiple linkages. For example, on weak it would produce the current behavior we have for objc metadata. On internal, it would be equivalent to private (and we should then remove private).
llvm-svn: 203866
show more ...
|
#
e94a518a |
| 11-Mar-2014 |
Tim Northover <tnorthover@apple.com> |
IR: add a second ordering operand to cmpxhg for failure
The syntax for "cmpxchg" should now look something like:
cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic
where the second ordering argu
IR: add a second ordering operand to cmpxhg for failure
The syntax for "cmpxchg" should now look something like:
cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic
where the second ordering argument gives the required semantics in the case that no exchange takes place. It should be no stronger than the first ordering constraint and cannot be either "release" or "acq_rel" (since no store will have taken place).
rdar://problem/15996804
llvm-svn: 203559
show more ...
|
#
cdf47884 |
| 09-Mar-2014 |
Chandler Carruth <chandlerc@gmail.com> |
[C++11] Add range based accessors for the Use-Def chain of a Value.
This requires a number of steps. 1) Move value_use_iterator into the Value class as an implementation detail 2) Change it to ac
[C++11] Add range based accessors for the Use-Def chain of a Value.
This requires a number of steps. 1) Move value_use_iterator into the Value class as an implementation detail 2) Change it to actually be a *Use* iterator rather than a *User* iterator. 3) Add an adaptor which is a User iterator that always looks through the Use to the User. 4) Wrap these in Value::use_iterator and Value::user_iterator typedefs. 5) Add the range adaptors as Value::uses() and Value::users(). 6) Update *all* of the callers to correctly distinguish between whether they wanted a use_iterator (and to explicitly dig out the User when needed), or a user_iterator which makes the Use itself totally opaque.
Because #6 requires churning essentially everything that walked the Use-Def chains, I went ahead and added all of the range adaptors and switched them to range-based loops where appropriate. Also because the renaming requires at least churning every line of code, it didn't make any sense to split these up into multiple commits -- all of which would touch all of the same lies of code.
The result is still not quite optimal. The Value::use_iterator is a nice regular iterator, but Value::user_iterator is an iterator over User*s rather than over the User objects themselves. As a consequence, it fits a bit awkwardly into the range-based world and it has the weird extra-dereferencing 'operator->' that so many of our iterators have. I think this could be fixed by providing something which transforms a range of T&s into a range of T*s, but that *can* be separated into another patch, and it isn't yet 100% clear whether this is the right move.
However, this change gets us most of the benefit and cleans up a substantial amount of code around Use and User. =]
llvm-svn: 203364
show more ...
|