12 Commits

Author SHA1 Message Date
Peter Collingbourne
57c068763a IR. Change strip* family of functions to not look through aliases.
I noticed another instance of the issue where references to aliases were
being replaced with aliasees, this time in InstCombine. In the instance that
I saw it turned out to be only a QoI issue (a symbol ended up being missing
from the symbol table due to the last reference to the alias being removed,
preventing HWASAN from symbolizing a global reference), but it could easily
have manifested as incorrect behaviour.

Since this is the third such issue encountered (previously: D65118, D65314)
it seems to be time to address this common error/QoI issue once and for all
and make the strip* family of functions not look through aliases.

Includes a test for the specific issue that I saw, but no doubt there are
other similar bugs fixed here.

As with D65118 this has been tested to make sure that the optimization isn't
load bearing. I built Clang, Chromium for Linux, Android and Windows as well
as the test-suite and there were no size regressions.

Differential Revision: https://reviews.llvm.org/D66606

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369697 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 19:56:14 +00:00
Jonas Hahnfeld
8db4d53651 Hide two unused debugging methods, NFCI.
GCC correctly moans that PlainCFGBuilder::isExternalDef(llvm::Value*) and
StackSafetyDataFlowAnalysis::verifyFixedPoint() are defined but not used
in Release builds. Hide them behind 'ifndef NDEBUG'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355205 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 17:15:21 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Vedant Kumar
eeb1971b1c [IR] Add Instruction::isLifetimeStartOrEnd, NFC
Instruction::isLifetimeStartOrEnd() checks whether an Instruction is an
llvm.lifetime.start or an llvm.lifetime.end intrinsic.

This was suggested as a cleanup in D55967.

Differential Revision: https://reviews.llvm.org/D56019

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349964 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 21:49:40 +00:00
Vitaly Buka
2aeaa6efdf [stack-safety] Update comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347626 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-27 01:56:44 +00:00
Vitaly Buka
fd4afd6605 [stack-safety] Fix and uncomment assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347625 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-27 01:56:35 +00:00
Vitaly Buka
61eaf0116a [stack-safety] Fix build on gcc 5.4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347624 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-27 01:56:26 +00:00
JF Bastien
3f6a8f98bb Fix debug build break
Comment out an assertion from D54543 which failed with error: no member named 'Range' in '(anonymous namespace)::PassAsArgInfo'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347616 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 23:48:47 +00:00
Vitaly Buka
d5aa33e7db [stack-safety] Inter-Procedural Analysis implementation
Summary:
IPA is implemented as module pass which produce map from Function or Alias to
StackSafetyInfo for a single function.

From prototype by Evgenii Stepanov and Vlad Tsyrklevich.

Reviewers: eugenis, vlad.tsyrklevich, pcc, glider

Subscribers: hiraditya, mgrang, llvm-commits

Differential Revision: https://reviews.llvm.org/D54543

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347611 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 23:05:58 +00:00
Vitaly Buka
54b4ae7d7b [stack-safety] Empty local passes for Stack Safety Global Analysis
Reviewers: eugenis, vlad.tsyrklevich

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D54541

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347610 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 23:05:48 +00:00
Vitaly Buka
9d4b9a36a0 [stack-safety] Local analysis implementation
Summary:
Analysis produces StackSafetyInfo which contains information with how allocas
and parameters were used in functions.

From prototype by Evgenii Stepanov and  Vlad Tsyrklevich.

Reviewers: eugenis, vlad.tsyrklevich, pcc, glider

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D54504

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347603 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 21:57:59 +00:00
Vitaly Buka
c29e36f3ee [stack-safety] Empty local passes for Stack Safety Local Analysis
Reviewers: eugenis, vlad.tsyrklevich

Subscribers: mgorny, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D54502

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347602 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 21:57:47 +00:00