|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
6e3d4712 |
| 25-Jun-2022 |
Pavel Samolysov <[email protected]> |
[DeadArgElim] Replace insert with emplace (NFC)
|
|
Revision tags: llvmorg-14.0.6 |
|
| #
f44bf380 |
| 17-Jun-2022 |
Pavel Samolysov <[email protected]> |
[DeadArgElim] Reformat the pass in accordance with the code style
The code has been reformatted in accordance with the code style. Some function comments were extended to the Doxygen ones and reword
[DeadArgElim] Reformat the pass in accordance with the code style
The code has been reformatted in accordance with the code style. Some function comments were extended to the Doxygen ones and reworded a bit to eliminate the duplication of the function's/class' name in the comment.
Differential Revision: https://reviews.llvm.org/D128168
show more ...
|
|
Revision tags: llvmorg-14.0.5 |
|
| #
340b0ca9 |
| 06-Jun-2022 |
Venkata Ramanaiah Nalamothu <[email protected]> |
[llvm] Add DW_CC_nocall to function debug metadata when either return values or arguments are removed
Adding the `DW_CC_nocall` calling convention to the function debug metadata is needed when eithe
[llvm] Add DW_CC_nocall to function debug metadata when either return values or arguments are removed
Adding the `DW_CC_nocall` calling convention to the function debug metadata is needed when either the return values or the arguments of a function are removed as this helps in informing debugger that it may not be safe to call this function or try to interpret the return value. This translates to setting `DW_AT_calling_convention` with `DW_CC_nocall` for appropriate DWARF DIEs.
The DWARF5 spec (section 3.3.1.1 Calling Convention Information) says:
If the `DW_AT_calling_convention` attribute is not present, or its value is the constant `DW_CC_normal`, then the subroutine may be safely called by obeying the `standard` calling conventions of the target architecture. If the value of the calling convention attribute is the constant `DW_CC_nocall`, the subroutine does not obey standard calling conventions, and it may not be safe for the debugger to call this subroutine.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D127134
show more ...
|
| #
11136a60 |
| 09-Jun-2022 |
Fangrui Song <[email protected]> |
[DeadArgElim] Remove dead code after r128810
|
|
Revision tags: llvmorg-14.0.4 |
|
| #
5fc9449c |
| 19-May-2022 |
Nuno Lopes <[email protected]> |
[DeadArgElim] Use poison instead of undef as placeholder for dead arguments
It doesn't matter which value we use for dead args, so let's switch to poison, so we can eventually kill undef.
Reviewed
[DeadArgElim] Use poison instead of undef as placeholder for dead arguments
It doesn't matter which value we use for dead args, so let's switch to poison, so we can eventually kill undef.
Reviewed By: aeubanks, fhahn
Differential Revision: https://reviews.llvm.org/D125983
show more ...
|
| #
9766fed9 |
| 03-May-2022 |
Quentin Colombet <[email protected]> |
[DeadArgElim] Re-apply: Set unused arguments for internal functions
The re-apply includes fixes to clang tests that were missed in the original commit.
Original message: Prior to this patch we woul
[DeadArgElim] Re-apply: Set unused arguments for internal functions
The re-apply includes fixes to clang tests that were missed in the original commit.
Original message: Prior to this patch we would only set to undef the unused arguments of the external functions. The rationale was that unused arguments of internal functions wouldn't need to be turned into undef arguments because they should have been simply eliminated by the time we reach that code.
This is actually not true because there are plenty of cases where we can't remove unused arguments. For instance, if the internal function is used in an indirect call, it may not be possible to change the function signature. Yet, for statically known call-sites we would still like to mark the unused arguments as undef.
This patch enables the "set undef arguments" optimization on internal functions when we encounter cases where internal functions cannot be optimized. I.e., whenever an internal function is marked "live".
Differential Revision: https://reviews.llvm.org/D124699
show more ...
|
| #
098e8070 |
| 02-May-2022 |
Vitaly Buka <[email protected]> |
Revert "[DeadArgElim] Set unused arguments for internal functions"
Breaks bots, see https://reviews.llvm.org/D124699
This reverts commit e547a333a43348a8a7ec9460f37696ecc5453e56.
|
| #
e547a333 |
| 29-Apr-2022 |
Quentin Colombet <[email protected]> |
[DeadArgElim] Set unused arguments for internal functions
Prior to this patch we would only set to undef the unused arguments of the external functions. The rationale was that unused arguments of in
[DeadArgElim] Set unused arguments for internal functions
Prior to this patch we would only set to undef the unused arguments of the external functions. The rationale was that unused arguments of internal functions wouldn't need to be turned into undef arguments because they should have been simply eliminated by the time we reach that code.
This is actually not true because there are plenty of cases where we can't remove unused arguments. For instance, if the internal function is used in an indirect call, it may not be possible to change the function signature. Yet, for statically known call-sites we would still like to mark the unused arguments as undef.
This patch enables the "set undef arguments" optimization on internal functions when we encounter cases where internal functions cannot be optimized. I.e., whenever an internal function is marked "live".
Differential Revision: https://reviews.llvm.org/D124699
show more ...
|
|
Revision tags: llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
f1985a3f |
| 21-Mar-2022 |
serge-sans-paille <[email protected]> |
Cleanup includes: Transforms/IPO
Preprocessor output diff: -238205 lines Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.ll
Cleanup includes: Transforms/IPO
Preprocessor output diff: -238205 lines Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D122183
show more ...
|
| #
3ec44c22 |
| 14-Mar-2022 |
Nikita Popov <[email protected]> |
[DeadArgElim] Guard against function type mismatch
If the call function type and function type don't match, we should consider the function live (there is effectively a bitcast sitting in between).
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2 |
|
| #
41c5a762 |
| 14-Feb-2022 |
Nikita Popov <[email protected]> |
[DeadArgElim] Check that function type is the same
If the function types differ, the call arguments don't necessarily correspon to the function arguments. It's likely not worthwhile to handle this m
[DeadArgElim] Check that function type is the same
If the function types differ, the call arguments don't necessarily correspon to the function arguments. It's likely not worthwhile to handle this more precisely, but at least we shouldn't crash.
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
| #
d2cc6c2d |
| 03-Jan-2022 |
Serge Guelton <[email protected]> |
Use a sorted array instead of a map to store AttrBuilder string attributes
Using and std::map<SmallString, SmallString> for target dependent attributes is inefficient: it makes its constructor sligh
Use a sorted array instead of a map to store AttrBuilder string attributes
Using and std::map<SmallString, SmallString> for target dependent attributes is inefficient: it makes its constructor slightly heavier, and involves extra allocation for each new string attribute. Storing the attribute key/value as strings implies extra allocation/copy step.
Use a sorted vector instead. Given the low number of attributes generally involved, this is cheaper, as showcased by
https://llvm-compile-time-tracker.com/compare.php?from=5de322295f4ade692dc4f1823ae4450ad3c48af2&to=05bc480bf641a9e3b466619af43a2d123ee3f71d&stat=instructions
Differential Revision: https://reviews.llvm.org/D116599
show more ...
|
| #
9290ccc3 |
| 04-Jan-2022 |
serge-sans-paille <[email protected]> |
Introduce the AttributeMask class
This class is solely used as a lightweight and clean way to build a set of attributes to be removed from an AttrBuilder. Previously AttrBuilder was used both for bu
Introduce the AttributeMask class
This class is solely used as a lightweight and clean way to build a set of attributes to be removed from an AttrBuilder. Previously AttrBuilder was used both for building and removing, which introduced odd situation like creation of Attribute with dummy value because the only relevant part was the attribute kind.
Differential Revision: https://reviews.llvm.org/D116110
show more ...
|
|
Revision tags: llvmorg-13.0.1-rc1 |
|
| #
1b108ab9 |
| 03-Nov-2021 |
Kazu Hirata <[email protected]> |
[Transforms] Use make_early_inc_range (NFC)
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
| #
d9e46bea |
| 14-Sep-2021 |
Kazu Hirata <[email protected]> |
[IPO] Use make_early_inc_range (NFC)
|
|
Revision tags: llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
| #
80ea2bb5 |
| 13-Aug-2021 |
Arthur Eubanks <[email protected]> |
[NFC] Rename AttributeList::getParam/Ret/FnAttributes() -> get*Attributes()
This is more consistent with similar methods.
|
| #
a0c42ca5 |
| 13-Aug-2021 |
Arthur Eubanks <[email protected]> |
[NFC] Remove AttributeList::hasParamAttribute()
It's the same as AttributeList::hasParamAttr().
|
|
Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init |
|
| #
087a8eea |
| 25-Jul-2021 |
Nikita Popov <[email protected]> |
[Attributes] Clean up handling of UB implying attributes (NFC)
Rather than adding methods for dropping these attributes in various places, add a function that returns an AttrBuilder with these attri
[Attributes] Clean up handling of UB implying attributes (NFC)
Rather than adding methods for dropping these attributes in various places, add a function that returns an AttrBuilder with these attributes, which can then be used with existing methods for dropping attributes. This is with an eye on D104641, which also needs to drop them from returns, not just parameters.
Also be more explicit about the semantics of the method in the documentation. Refer to UB rather than Undef, which is what this is actually about.
show more ...
|
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4 |
|
| #
3240910f |
| 25-Mar-2021 |
Guozhi Wei <[email protected]> |
[DAE] Adjust param/arg attributes when changing parameter to undef
In DeadArgumentElimination pass, if a function's argument is never used, corresponding caller's parameter can be changed to undef.
[DAE] Adjust param/arg attributes when changing parameter to undef
In DeadArgumentElimination pass, if a function's argument is never used, corresponding caller's parameter can be changed to undef. If the param/arg has attribute noundef or other related attributes, LLVM LangRef(https://llvm.org/docs/LangRef.html#parameter-attributes) says its behavior is undefined. SimplifyCFG(D97244) takes advantage of this behavior and does bad transformation on valid code.
To avoid this undefined behavior when change caller's parameter to undef, this patch removes noundef attribute and other attributes imply noundef on param/arg.
Differential Revision: https://reviews.llvm.org/D98899
show more ...
|
|
Revision tags: llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init |
|
| #
925ae8c7 |
| 25-Jan-2021 |
Richard Smith <[email protected]> |
Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV"
This reverts commit 53176c168061d6f26dcf3ce4fa59288b7d67255e, which introduceed a layering violation. LLVM's IR libra
Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV"
This reverts commit 53176c168061d6f26dcf3ce4fa59288b7d67255e, which introduceed a layering violation. LLVM's IR library can't include headers from Analysis.
show more ...
|
| #
53176c16 |
| 25-Jan-2021 |
Akira Hatanaka <[email protected]> |
[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR
Background:
This patch makes changes to the front-end and middle-end that are needed to fix a long
[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR
Background:
This patch makes changes to the front-end and middle-end that are needed to fix a longstanding problem where llvm breaks ARC's autorelease optimization (see the link below) by separating calls from the marker instructions or retainRV/claimRV calls. The backend changes are in https://reviews.llvm.org/D92569.
https://clang.llvm.org/docs/AutomaticReferenceCounting.html#arc-runtime-objc-autoreleasereturnvalue
What this patch does to fix the problem:
- The front-end annotates calls with attribute "clang.arc.rv"="retain" or "clang.arc.rv"="claim", which indicates the call is implicitly followed by a marker instruction and a retainRV/claimRV call that consumes the call result. This is currently done only when the target is arm64 and the optimization level is higher than -O0.
- ARC optimizer temporarily emits retainRV/claimRV calls after the annotated calls in the IR and removes the inserted calls after processing the function.
- ARC contract pass emits retainRV/claimRV calls after the annotated calls. It doesn't remove the attribute on the call since the backend needs it to emit the marker instruction. The retainRV/claimRV calls are emitted late in the pipeline to prevent optimization passes from transforming the IR in a way that makes it harder for the ARC middle-end passes to figure out the def-use relationship between the call and the retainRV/claimRV calls (which is the cause of PR31925).
- The function inliner removes the autoreleaseRV call in the callee that returns the result if nothing in the callee prevents it from being paired up with the calls annotated with "clang.arc.rv"="retain/claim" in the caller. If the call is annotated with "claim", a release call is inserted since autoreleaseRV+claimRV is equivalent to a release. If it cannot find an autoreleaseRV call, it tries to transfer the attributes to a function call in the callee. This is important since ARC optimizer can remove the autoreleaseRV call returning the callee result, which makes it impossible to pair it up with the retainRV or claimRV call in the caller. If that fails, it simply emits a retain call in the IR if the call is annotated with "retain" and does nothing if it's annotated with "claim".
- This patch teaches dead argument elimination pass not to change the return type of a function if any of the calls to the function are annotated with attribute "clang.arc.rv". This is necessary since the pass can incorrectly determine nothing in the IR uses the function return, which can happen since the front-end no longer explicitly emits retainRV/claimRV calls in the IR, and change its return type to 'void'.
Future work:
- Use the attribute on x86-64.
- Fix the auto upgrader to convert call+retainRV/claimRV pairs into calls annotated with the attributes.
rdar://71443534
Differential Revision: https://reviews.llvm.org/D92808
show more ...
|
|
Revision tags: llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5 |
|
| #
7468afe9 |
| 30-Sep-2020 |
Arthur Eubanks <[email protected]> |
[DAE] MarkLive in MarkValue(MaybeLive) if any use is live
While looping through all args or all return values, we may mark a use of a later iteration as live. Previously when we got to that later va
[DAE] MarkLive in MarkValue(MaybeLive) if any use is live
While looping through all args or all return values, we may mark a use of a later iteration as live. Previously when we got to that later value it would ignore that and continue adding to Uses instead of marking it live. For example, when looping through arg#0 and arg#1, MarkValue(arg#0, Live) may cause some use of arg#1 to be live, but MarkValue(arg#1, MaybeLive) will not notice that and continue adding into Uses.
Now MarkValue(RA, MaybeLive) will MarkLive(RA) if any use is live.
Fixes PR47444.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D88529
show more ...
|
|
Revision tags: llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3 |
|
| #
023883a8 |
| 29-Jun-2020 |
Matt Arsenault <[email protected]> |
IR: Rename Argument::hasPassPointeeByValueAttr to prepare for byref
When the byref attribute is added, there will need to be two similar functions for the existing cases which have an associate valu
IR: Rename Argument::hasPassPointeeByValueAttr to prepare for byref
When the byref attribute is added, there will need to be two similar functions for the existing cases which have an associate value copy, and byref which does not. Most, but not all of the existing uses will use the existing version.
The associated size function added by D82679 also needs to contextually differ, and will help eliminate a few places still relying on pointee element types.
show more ...
|
| #
1af8c93b |
| 14-Jul-2020 |
Djordje Todorovic <[email protected]> |
[deadargelim] Attach dbg info to the insert/extractvalue instructions
Attach DbgLoc on insertvalue/extractvalue instructions created by DeadArgumentElimination.
This fixes the PR46350.
Differentia
[deadargelim] Attach dbg info to the insert/extractvalue instructions
Attach DbgLoc on insertvalue/extractvalue instructions created by DeadArgumentElimination.
This fixes the PR46350.
Differential Revision: https://reviews.llvm.org/D81939
show more ...
|
|
Revision tags: llvmorg-10.0.1-rc2 |
|
| #
417bcb88 |
| 04-Jun-2020 |
Yevgeny Rouban <[email protected]> |
[Instruction] Remove setProfWeight()
Remove the function Instruction::setProfWeight() and make use of Instruction::copyMetadata(.., {LLVMContext::MD_prof}). This is correct for all use cases of setP
[Instruction] Remove setProfWeight()
Remove the function Instruction::setProfWeight() and make use of Instruction::copyMetadata(.., {LLVMContext::MD_prof}). This is correct for all use cases of setProfWeight() as it is applied to CallBase instructions only. This change results in prof metadata copied intact even if the source has "VP". The old pair of calls extractProfTotalWeight() + setProfWeight() resulted in setting branch_weights if the source had "VP" data.
Reviewers: yamauchi, davidxl Tags: #llvm Differential Revision: https://reviews.llvm.org/D80987
show more ...
|