#
f01488e2 |
| 15-Jan-2016 |
James Molloy <james.molloy@arm.com> |
[InstCombine] Rewrite bswap/bitreverse handling completely.
There are several requirements that ended up with this design; 1. Matching bitreversals is too heavyweight for InstCombine and doesn't r
[InstCombine] Rewrite bswap/bitreverse handling completely.
There are several requirements that ended up with this design; 1. Matching bitreversals is too heavyweight for InstCombine and doesn't really need to be done so early. 2. Bitreversals and byteswaps are very related in their matching logic. 3. We want to implement support for matching more advanced bswap/bitreverse patterns like partial bswaps/bitreverses. 4. Bswaps are best matched early in InstCombine.
The result of these is that a new utility function is created in Transforms/Utils/Local.h that can be configured to search for bswaps, bitreverses or both. InstCombine uses it to find only bswaps, CGP uses it to find only bitreversals.
We can then extend the matching logic in one place only.
llvm-svn: 257875
show more ...
|
#
1dd319f3 |
| 14-Jan-2016 |
Keno Fischer <kfischer@college.harvard.edu> |
[Utils] Fix incorrect dbg.declare store conversion
Summary: The dbg.declare -> dbg.value conversion did not check which operand of the store instruction the alloca was passed to. As a result code th
[Utils] Fix incorrect dbg.declare store conversion
Summary: The dbg.declare -> dbg.value conversion did not check which operand of the store instruction the alloca was passed to. As a result code that stored the address of an alloca, rather than storing to the alloca, would still trigger the conversion routine, leading to the insertion of an incorrect dbg.value intrinsic.
Reviewers: aprantl
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16169
llvm-svn: 257787
show more ...
|
#
582f5562 |
| 14-Jan-2016 |
James Y Knight <jyknight@google.com> |
Revert "Stop increasing alignment of externally-visible globals on ELF platforms."
This reverts commit r257719, due to PR26144.
llvm-svn: 257775
|
#
9de6d7be |
| 13-Jan-2016 |
James Y Knight <jyknight@google.com> |
Stop increasing alignment of externally-visible globals on ELF platforms.
With ELF, the alignment of a global variable in a shared library will get copied into an executables linked against it, if t
Stop increasing alignment of externally-visible globals on ELF platforms.
With ELF, the alignment of a global variable in a shared library will get copied into an executables linked against it, if the executable even accesss the variable. So, it's not possible to implicitly increase alignment based on access patterns, or you'll break existing binaries.
This happened to affect libc++'s std::cout symbol, for example. See thread: http://thread.gmane.org/gmane.comp.compilers.clang.devel/45311
llvm-svn: 257719
show more ...
|
#
9aae445e |
| 12-Jan-2016 |
Keno Fischer <kfischer@college.harvard.edu> |
[Utils] Insert DW_OP_bit_piece when only describing part of the variable
Summary: The dbg.declare -> dbg.value conversion looks through any zext/sext to find a value to describe the variable (in the
[Utils] Insert DW_OP_bit_piece when only describing part of the variable
Summary: The dbg.declare -> dbg.value conversion looks through any zext/sext to find a value to describe the variable (in the expectation that those zext/sext instruction will go away later). However, those values do not cover the entire variable and thus need a DW_OP_bit_piece.
Reviewers: aprantl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16061
llvm-svn: 257534
show more ...
|
#
d9833ea5 |
| 10-Jan-2016 |
David Majnemer <david.majnemer@gmail.com> |
[JumpThreading] Don't forget to report that the IR changed
JumpThreading's runOnFunction is supposed to return true if it made any changes. JumpThreading has a call to removeUnreachableBlocks which
[JumpThreading] Don't forget to report that the IR changed
JumpThreading's runOnFunction is supposed to return true if it made any changes. JumpThreading has a call to removeUnreachableBlocks which may result in changes to the IR but runOnFunction didn't appropriate account for this possibility, leading to badness.
While we are here, make sure to call LazyValueInfo::eraseBlock in removeUnreachableBlocks; JumpThreading preserves LVI.
This fixes PR26096.
llvm-svn: 257279
show more ...
|
#
3eedd113 |
| 05-Jan-2016 |
Manuel Jacob <me@manueljacob.de> |
[Statepoints] Check for the "gc-leaf-function" attribute on call sites as well.
Reviewers: sanjoy, reames
Subscribers: sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D15900
l
[Statepoints] Check for the "gc-leaf-function" attribute on call sites as well.
Reviewers: sanjoy, reames
Subscribers: sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D15900
llvm-svn: 256875
show more ...
|
#
59eb733a |
| 05-Jan-2016 |
David Majnemer <david.majnemer@gmail.com> |
[SimplifyCFG] Further improve our ability to remove redundant catchpads
In r256814, we managed to remove catchpads which were trivially redudant because they were the same SSA value. We can do bett
[SimplifyCFG] Further improve our ability to remove redundant catchpads
In r256814, we managed to remove catchpads which were trivially redudant because they were the same SSA value. We can do better using the same algorithm but with a smarter datastructure by hashing the SSA values within the catchpad and comparing them structurally.
llvm-svn: 256815
show more ...
|
#
2fa8651a |
| 05-Jan-2016 |
David Majnemer <david.majnemer@gmail.com> |
[SimplifyCFG] Remove redundant catchpads
Remove duplicate catchpad handlers from a catchswitch.
llvm-svn: 256814
|
#
00cbf9a6 |
| 19-Dec-2015 |
Keno Fischer <kfischer@college.harvard.edu> |
Clean up the processing of dbg.value in various places
Summary: First up is instcombine, where in the dbg.declare -> dbg.value conversion, the llvm.dbg.value needs to be called on the actual loaded
Clean up the processing of dbg.value in various places
Summary: First up is instcombine, where in the dbg.declare -> dbg.value conversion, the llvm.dbg.value needs to be called on the actual loaded value, rather than the address (since the whole point of this transformation is to be able to get rid of the alloca). Further, now that that's cleaned up, we can remove a hack in the backend, that would add an implicit OP_deref if the argument to dbg.value was an alloca. This stems from before the existence of DIExpression and is no longer necessary since the deref can be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to correct the printing of DEBUG_VALUE comments to take into account the expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect test cases (mostly the wrong number of DW_OP_derefs, but also a couple where the test itself was broken more badly). aprantl and I have gone through and adjusted these test case in order to make them pass with these fixes and in some cases to make sure they're actually testing what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
show more ...
|
#
3bb88c02 |
| 15-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Use operand bundles to describe call sites
SimplifyCFG allows tail merging with code which terminates in unreachable which, in turn, makes it possible for an invoke to end up in a funclet wh
[WinEH] Use operand bundles to describe call sites
SimplifyCFG allows tail merging with code which terminates in unreachable which, in turn, makes it possible for an invoke to end up in a funclet which it was not originally part of.
Using operand bundles on invokes allows us to determine whether or not an invoke was part of a funclet in the source program.
Furthermore, it allows us to unambiguously answer questions about the legality of inlining into call sites which the personality may have trouble with.
Differential Revision: http://reviews.llvm.org/D15517
llvm-svn: 255674
show more ...
|
#
bbfc7219 |
| 14-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
[IR] Remove terminatepad
It turns out that terminatepad gives little benefit over a cleanuppad which calls the termination function. This is not sufficient to implement fully generic filters but MS
[IR] Remove terminatepad
It turns out that terminatepad gives little benefit over a cleanuppad which calls the termination function. This is not sufficient to implement fully generic filters but MSVC doesn't support them which makes terminatepad a little over-designed.
Depends on D15478.
Differential Revision: http://reviews.llvm.org/D15479
llvm-svn: 255522
show more ...
|
#
8a1c45d6 |
| 12-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
[IR] Reformulate LLVM's EH funclet IR
While we have successfully implemented a funclet-oriented EH scheme on top of LLVM IR, our scheme has some notable deficiencies: - catchendpad and cleanupendpad
[IR] Reformulate LLVM's EH funclet IR
While we have successfully implemented a funclet-oriented EH scheme on top of LLVM IR, our scheme has some notable deficiencies: - catchendpad and cleanupendpad are necessary in the current design but they are difficult to explain to others, even to seasoned LLVM experts. - catchendpad and cleanupendpad are optimization barriers. They cannot be split and force all potentially throwing call-sites to be invokes. This has a noticable effect on the quality of our code generation. - catchpad, while similar in some aspects to invoke, is fairly awkward. It is unsplittable, starts a funclet, and has control flow to other funclets. - The nesting relationship between funclets is currently a property of control flow edges. Because of this, we are forced to carefully analyze the flow graph to see if there might potentially exist illegal nesting among funclets. While we have logic to clone funclets when they are illegally nested, it would be nicer if we had a representation which forbade them upfront.
Let's clean this up a bit by doing the following: - Instead, make catchpad more like cleanuppad and landingpad: no control flow, just a bunch of simple operands; catchpad would be splittable. - Introduce catchswitch, a control flow instruction designed to model the constraints of funclet oriented EH. - Make funclet scoping explicit by having funclet instructions consume the token produced by the funclet which contains them. - Remove catchendpad and cleanupendpad. Their presence can be inferred implicitly using coloring information.
N.B. The state numbering code for the CLR has been updated but the veracity of it's output cannot be spoken for. An expert should take a look to make sure the results are reasonable.
Reviewers: rnk, JosephTremoulet, andrew.w.kaylor
Differential Revision: http://reviews.llvm.org/D15139
llvm-svn: 255422
show more ...
|
#
ccd14566 |
| 10-Dec-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
Add arg_begin() and arg_end() to CallInst and InvokeInst; NFCI
- This simplifies the CallSite class, arg_begin / arg_end are now simple wrapper getters.
- In several places, we were creating C
Add arg_begin() and arg_end() to CallInst and InvokeInst; NFCI
- This simplifies the CallSite class, arg_begin / arg_end are now simple wrapper getters.
- In several places, we were creating CallSite instances solely to call arg_begin and arg_end. With this change, that's no longer required.
llvm-svn: 255226
show more ...
|
#
8a954a05 |
| 08-Dec-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
[OperandBundles] Fix a transform in simplifycfg
Reviewers: pcc, majnemer, reames
Subscribers: reames, llvm-commits
Differential Revision: http://reviews.llvm.org/D15345
llvm-svn: 255062
|
#
70497c69 |
| 02-Dec-2015 |
David Majnemer <david.majnemer@gmail.com> |
Move EH-specific helper functions to a more appropriate place
No functionality change is intended.
llvm-svn: 254562
|
#
42f3b122 |
| 01-Dec-2015 |
Evgeniy Stepanov <eugeni.stepanov@gmail.com> |
[safestack] Protect byval function arguments.
Detect unsafe byval function arguments and move them to the unsafe stack.
llvm-svn: 254353
|
Revision tags: llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1 |
|
#
5c5011d5 |
| 02-Nov-2015 |
Artur Pilipenko <apilipenko@azulsystems.com> |
Preserve load alignment and dereferenceable metadata during some transformations
Reviewed By: hfinkel
Differential Revision: http://reviews.llvm.org/D13953
llvm-svn: 251809
|
#
5b4c837c |
| 13-Oct-2015 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
TransformUtils: Remove implicit ilist iterator conversions, NFC
Continuing the work from last week to remove implicit ilist iterator conversions. First related commit was probably r249767, with som
TransformUtils: Remove implicit ilist iterator conversions, NFC
Continuing the work from last week to remove implicit ilist iterator conversions. First related commit was probably r249767, with some more motivation in r249925. This edition gets LLVMTransformUtils compiling without the implicit conversions.
No functional change intended.
llvm-svn: 250142
show more ...
|
#
c21a05a3 |
| 08-Oct-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
[PlaceSafeopints] Extract out `callsGCLeafFunction`, NFC
Summary: This will be used in a later change to RewriteStatepointsForGC.
Reviewers: reames, swaroop.sridhar
Subscribers: llvm-commits
Diff
[PlaceSafeopints] Extract out `callsGCLeafFunction`, NFC
Summary: This will be used in a later change to RewriteStatepointsForGC.
Reviewers: reames, swaroop.sridhar
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13490
llvm-svn: 249777
show more ...
|
#
dc9b2cfc |
| 02-Oct-2015 |
Piotr Padlewski <prazek@google.com> |
inariant.group handling in GVN
The most important part required to make clang devirtualization works ( ͡°͜ʖ ͡°). The code is able to find non local dependencies, but unfortunatelly because the calle
inariant.group handling in GVN
The most important part required to make clang devirtualization works ( ͡°͜ʖ ͡°). The code is able to find non local dependencies, but unfortunatelly because the caller can only handle local dependencies, I had to add some restrictions to look for dependencies only in the same BB.
http://reviews.llvm.org/D12992
llvm-svn: 249196
show more ...
|
#
f608111d |
| 30-Sep-2015 |
Evgeniy Stepanov <eugeni.stepanov@gmail.com> |
Fix debug info with SafeStack.
llvm-svn: 248933
|
#
d8b86f7c |
| 29-Sep-2015 |
Evgeniy Stepanov <eugeni.stepanov@gmail.com> |
Move dbg.declare intrinsics when merging and replacing allocas.
Place new and update dbg.declare calls immediately after the corresponding alloca.
Current code in replaceDbgDeclareForAlloca puts th
Move dbg.declare intrinsics when merging and replacing allocas.
Place new and update dbg.declare calls immediately after the corresponding alloca.
Current code in replaceDbgDeclareForAlloca puts the new dbg.declare at the end of the basic block. LLVM codegen has problems emitting debug info in a situation when dbg.declare appears after all uses of the variable. This usually kinda works for inlining and ASan (two users of this function) but not for SafeStack (see the pending change in http://reviews.llvm.org/D13178).
llvm-svn: 248769
show more ...
|
#
f74cc40e |
| 28-Sep-2015 |
Fiona Glaser <escha@apple.com> |
Improve performance of SimplifyInstructionsInBlock
1. Use a worklist, not a recursive approach, to avoid needless revisitation and being repeatedly forced to jump back to the start of the BB i
Improve performance of SimplifyInstructionsInBlock
1. Use a worklist, not a recursive approach, to avoid needless revisitation and being repeatedly forced to jump back to the start of the BB if a handle is invalidated.
2. Only insert operands to the worklist if they become unused after a dead instruction is removed, so we don’t have to visit them again in most cases.
3. Use a SmallSetVector to track the worklist.
4. Instead of pre-initting the SmallSetVector like in DeadCodeEliminationPass, only put things into the worklist if they have to be revisited after the first run-through. This minimizes how much the actual SmallSetVector gets used, which saves a lot of time.
llvm-svn: 248727
show more ...
|
#
09af67ab |
| 27-Sep-2015 |
Joseph Tremoulet <jotrem@microsoft.com> |
[EH] Create removeUnwindEdge utility
Summary: Factor the code that rewrites invokes to calls and rewrites WinEH terminators to their "unwind to caller" equivalents into a helper in Utils/Local, and
[EH] Create removeUnwindEdge utility
Summary: Factor the code that rewrites invokes to calls and rewrites WinEH terminators to their "unwind to caller" equivalents into a helper in Utils/Local, and use it in the three places I'm aware of that need to do this.
Reviewers: andrew.w.kaylor, majnemer, rnk
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13152
llvm-svn: 248677
show more ...
|