#
021de058 |
| 31-Mar-2016 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
Introduce a @llvm.experimental.guard intrinsic
Summary: As discussed on llvm-dev[1].
This change adds the basic boilerplate code around having this intrinsic in LLVM:
- Changes in Intrinsics.td,
Introduce a @llvm.experimental.guard intrinsic
Summary: As discussed on llvm-dev[1].
This change adds the basic boilerplate code around having this intrinsic in LLVM:
- Changes in Intrinsics.td, and the IR Verifier - A lowering pass to lower @llvm.experimental.guard to normal control flow - Inliner support
[1]: http://lists.llvm.org/pipermail/llvm-dev/2016-February/095523.html
Reviewers: reames, atrick, chandlerc, rnk, JosephTremoulet, echristo
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D18527
llvm-svn: 264976
show more ...
|
#
b51325db |
| 11-Mar-2016 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
Introduce @llvm.experimental.deoptimize
Summary: This intrinsic, together with deoptimization operand bundles, allow frontends to express transfer of control and frame-local state from one (typicall
Introduce @llvm.experimental.deoptimize
Summary: This intrinsic, together with deoptimization operand bundles, allow frontends to express transfer of control and frame-local state from one (typically more specialized, hence faster) version of a function into another (typically more generic, hence slower) version.
In languages with a fully integrated managed runtime this intrinsic can be used to implement "uncommon trap" like functionality. In unmanaged languages like C and C++, this intrinsic can be used to represent the slow paths of specialized functions.
Note: this change does not address how `@llvm.experimental_deoptimize` is lowered. That will be done in a later change.
Reviewers: chandlerc, rnk, atrick, reames
Subscribers: llvm-commits, kmod, mjacob, maksfb, mcrosier, JosephTremoulet
Differential Revision: http://reviews.llvm.org/D17732
llvm-svn: 263281
show more ...
|
#
b1bd398c |
| 08-Mar-2016 |
Easwaran Raman <eraman@google.com> |
Revert revisions 262636, 262643, 262679, and 262682.
llvm-svn: 262883
|
#
3b7a8246 |
| 04-Mar-2016 |
Easwaran Raman <eraman@google.com> |
Fix a use-after-free bug introduced in r262636
llvm-svn: 262679
|
#
3035719c |
| 03-Mar-2016 |
Easwaran Raman <eraman@google.com> |
Infrastructure for PGO enhancements in inliner
This patch provides the following infrastructure for PGO enhancements in inliner:
Enable the use of block level profile information in inliner Increme
Infrastructure for PGO enhancements in inliner
This patch provides the following infrastructure for PGO enhancements in inliner:
Enable the use of block level profile information in inliner Incremental update of block frequency information during inlining Update the function entry counts of callees when they get inlined into callers.
Differential Revision: http://reviews.llvm.org/D16381
llvm-svn: 262636
show more ...
|
Revision tags: llvmorg-3.8.0, llvmorg-3.8.0-rc3 |
|
#
223538f7 |
| 23-Feb-2016 |
David Majnemer <david.majnemer@gmail.com> |
[WinEH] Don't inline an 'unwinds to caller' cleanupret into funclets which locally unwind
It is problematic if the inlinee has a cleanupret which unwinds to caller and we inline it into a call site
[WinEH] Don't inline an 'unwinds to caller' cleanupret into funclets which locally unwind
It is problematic if the inlinee has a cleanupret which unwinds to caller and we inline it into a call site which doesn't unwind.
If the funclet unwinds anywhere other than to the caller, then we will give the funclet two unwind destinations. This will result in a verifier failure.
Seeing as how the caller wasn't an invoke (which would locally unwind) and that the funclet cannot unwind to caller, we must conclude that an 'unwind to caller' cleanupret is dynamically unreachable.
This fixes PR26698.
Differential Revision: http://reviews.llvm.org/D17536
llvm-svn: 261656
show more ...
|
Revision tags: llvmorg-3.8.0-rc2 |
|
#
b41632bf |
| 20-Jan-2016 |
Joseph Tremoulet <jotrem@microsoft.com> |
[Inliner/WinEH] Honor implicit nounwinds
Summary: Funclet EH tables require that a given funclet have only one unwind destination for exceptional exits. The verifier will therefore reject e.g. two
[Inliner/WinEH] Honor implicit nounwinds
Summary: Funclet EH tables require that a given funclet have only one unwind destination for exceptional exits. The verifier will therefore reject e.g. two cleanuprets with different unwind dests for the same cleanup, or two invokes exiting the same funclet but to different unwind dests. Because catchswitch has no 'nounwind' variant, and because IR producers are not *required* to annotate calls which will not unwind as 'nounwind', it is legal to nest a call or an "unwind to caller" catchswitch within a funclet pad that has an unwind destination other than caller; it is undefined behavior for such a call or catchswitch to unwind.
Normally when inlining an invoke, calls in the inlined sequence are rewritten to invokes that unwind to the callsite invoke's unwind destination, and "unwind to caller" catchswitches in the inlined sequence are rewritten to unwind to the callsite invoke's unwind destination. However, if such a call or "unwind to caller" catchswitch is located in a callee funclet that has another exceptional exit with an unwind destination within the callee, applying the normal transformation would give that callee funclet multiple unwind destinations for its exceptional exits. There would be no way for EH table generation to determine which is the "true" exit, and the verifier would reject the function accordingly.
Add logic to the inliner to detect these cases and leave such calls and "unwind to caller" catchswitches as calls and "unwind to caller" catchswitches in the inlined sequence.
This fixes PR26147.
Reviewers: rnk, andrew.w.kaylor, majnemer
Subscribers: alexcrichton, llvm-commits
Differential Revision: http://reviews.llvm.org/D16319
llvm-svn: 258273
show more ...
|
Revision tags: llvmorg-3.8.0-rc1 |
|
#
bba70e44 |
| 14-Jan-2016 |
Joseph Tremoulet <jotrem@microsoft.com> |
[OperandBundles] Copy DebugLoc with calls/invokes
Summary: The overloads of CallInst::Create and InvokeInst::Create that are used to adjust operand bundles purport to create a new instruction "ident
[OperandBundles] Copy DebugLoc with calls/invokes
Summary: The overloads of CallInst::Create and InvokeInst::Create that are used to adjust operand bundles purport to create a new instruction "identical in every way except [for] the operand bundles", so copy the DebugLoc along with everything else.
Reviewers: sanjoy, majnemer
Subscribers: majnemer, dblaikie, llvm-commits
Differential Revision: http://reviews.llvm.org/D16157
llvm-svn: 257745
show more ...
|
#
42c73555 |
| 13-Jan-2016 |
Sanjay Patel <spatel@rotateright.com> |
hasNUses(0) == use_empty() ; NFCI
Also, improve variable name and remove unnecessary braces.
llvm-svn: 257687
|
#
e01dcab3 |
| 13-Jan-2016 |
Sanjay Patel <spatel@rotateright.com> |
rangify; NFCI
llvm-svn: 257677
|
#
ab0626e3 |
| 19-Dec-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
Nonnull elements in OperandBundleCallSites are not all Instructions
`CloneAndPruneIntoFromInst` sometimes RAUW's dead instructions with `undef` before erasing them (to avoid deleting instructions th
Nonnull elements in OperandBundleCallSites are not all Instructions
`CloneAndPruneIntoFromInst` sometimes RAUW's dead instructions with `undef` before erasing them (to avoid deleting instructions that still have uses). This changes the `WeakVH` in `OperandBundleCallSites` to hold an `undef`, and we need to guard for this situation in eventuality in `llvm::InlineFunction`.
llvm-svn: 256110
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 ...
|
#
9abfb0b4 |
| 09-Dec-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
Use WeakVH to keep track of calls with operand bundles in CloneCodeInfo
`CloneAndPruneIntoFromInst` can DCE instructions after cloning them into the new function, and so an AssertingVH is too strong
Use WeakVH to keep track of calls with operand bundles in CloneCodeInfo
`CloneAndPruneIntoFromInst` can DCE instructions after cloning them into the new function, and so an AssertingVH is too strong. This change switches CloneCodeInfo to use a std::vector<WeakVH>.
llvm-svn: 255148
show more ...
|
#
8da1f959 |
| 08-Dec-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
[OperandBundles] Remove unncessary constructor
The StringRef constructor is unnecessary (since we're converting to std::string anyway), and having it requires an explicit call to StringRef's or std:
[OperandBundles] Remove unncessary constructor
The StringRef constructor is unnecessary (since we're converting to std::string anyway), and having it requires an explicit call to StringRef's or std::string's constructor.
llvm-svn: 255000
show more ...
|
Revision tags: llvmorg-3.7.1 |
|
#
c521c7be |
| 25-Nov-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
[OperandBundles] Extract duplicated code into a helper function, NFC
llvm-svn: 254047
|
#
45d4cb9a |
| 24-Nov-2015 |
Weiming Zhao <weimingz@codeaurora.org> |
[Utils] Put includes in correct order. NFC.
Summary: Followed the guidelines in: http://llvm.org/docs/CodingStandards.html#include-style However, I noticed that uppercase named head
[Utils] Put includes in correct order. NFC.
Summary: Followed the guidelines in: http://llvm.org/docs/CodingStandards.html#include-style However, I noticed that uppercase named headers come before lowercase ones throughout the codebase. So kept them as is. Patch by Mandeep Singh Grang <mgrang@codeaurora.org>
Reviewers: majnemer, davide, jmolloy, atrick
Subscribers: sanjoy
Differential Revision: http://reviews.llvm.org/D14939
llvm-svn: 254005
show more ...
|
Revision tags: llvmorg-3.7.1-rc2 |
|
#
67cf9a72 |
| 19-Nov-2015 |
Pete Cooper <peter_cooper@apple.com> |
Revert "Change memcpy/memset/memmove to have dest and source alignments."
This reverts commit r253511.
This likely broke the bots in http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/
Revert "Change memcpy/memset/memmove to have dest and source alignments."
This reverts commit r253511.
This likely broke the bots in http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202 http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787
llvm-svn: 253543
show more ...
|
#
72bc23ef |
| 18-Nov-2015 |
Pete Cooper <peter_cooper@apple.com> |
Change memcpy/memset/memmove to have dest and source alignments.
Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html
Thes
Change memcpy/memset/memmove to have dest and source alignments.
Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html
These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those.
This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed.
There are a few places in the code for which the code needs to be checked by an expert as to whether using only src/dest alignment is safe. For those places, they currently take the minimum of src/dest alignments which matches the current behaviour.
For example, code which used to read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false) will now read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false)
For out of tree owners, I was able to strip alignment from calls using sed by replacing: (call.*llvm\.memset.*)i32\ [0-9]*\,\ i1 false\) with: $1i1 false)
and similarly for memmove and memcpy.
I then added back in alignment to test cases which needed it.
A similar commit will be made to clang which actually has many differences in alignment as now IRBuilder can generate different source/dest alignments on calls.
In IRBuilder itself, a new argument was added. Instead of calling: CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, /* isVolatile */ false) you now call CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, SrcAlign, /* isVolatile */ false)
There is a temporary class (IntegerAlignment) which takes the source alignment and rejects implicit conversion from bool. This is to prevent isVolatile here from passing its default parameter to the source alignment.
Note, changes in future can now be made to codegen. I didn't change anything here, but this change should enable better memcpy code sequences.
Reviewed by Hal Finkel.
llvm-svn: 253511
show more ...
|
#
f79d3449 |
| 18-Nov-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
[OperandBundles] Tighten OperandBundleDef's interface; NFC
llvm-svn: 253446
|
#
2d16145a |
| 18-Nov-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
Teach the inliner to track deoptimization state
Summary: This change teaches LLVM's inliner to track and suitably adjust deoptimization state (tracked via deoptimization operand bundles) as it inlin
Teach the inliner to track deoptimization state
Summary: This change teaches LLVM's inliner to track and suitably adjust deoptimization state (tracked via deoptimization operand bundles) as it inlines through call sites. The operation is described in more detail in the LangRef changes.
Reviewers: reames, majnemer, chandlerc, dexonsmith
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D14552
llvm-svn: 253438
show more ...
|
Revision tags: llvmorg-3.7.1-rc1 |
|
#
0a1bee8a |
| 23-Oct-2015 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
[Inliner] Don't inline through callsites with operand bundles
Summary: This change teaches the LLVM inliner to not inline through callsites with unknown operand bundles. Currently all operand bundl
[Inliner] Don't inline through callsites with operand bundles
Summary: This change teaches the LLVM inliner to not inline through callsites with unknown operand bundles. Currently all operand bundles are "unknown" operand bundles but in the near future we will add support for inlining through some select kinds of operand bundles.
Reviewers: reames, chandlerc, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D14001
llvm-svn: 251141
show more ...
|
#
eba62796 |
| 13-Oct-2015 |
David Majnemer <david.majnemer@gmail.com> |
[InlineFunction] Correctly inline TerminatePadInst
We forgot to append the terminatepad's arguments which resulted in us treating the old terminatepad as an argument to the new terminatepad causing
[InlineFunction] Correctly inline TerminatePadInst
We forgot to append the terminatepad's arguments which resulted in us treating the old terminatepad as an argument to the new terminatepad causing us to crash immediately. Instead, add the old terminatepad's arguments to the new terminatepad.
This fixes PR25155.
llvm-svn: 250234
show more ...
|