History log of /llvm-project-15.0.7/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp (Results 1 – 25 of 442)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
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
# 87c92cd2 01-Aug-2022 Martin Sebor <[email protected]>

[InstCombine] Correct strtol folding with nonnull endptr

Reflect in the pointer's offset the length of the leading part
of the consumed string preceding the first converted digit.

Reviewed By: efri

[InstCombine] Correct strtol folding with nonnull endptr

Reflect in the pointer's offset the length of the leading part
of the consumed string preceding the first converted digit.

Reviewed By: efriedma

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

(cherry picked from commit bcef4d238d113c61127575bf5dd0328f97bda9e9)

show more ...


Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init
# 44476036 07-Jul-2022 Martin Sebor <[email protected]>

[InstCombine] Fold strtoul and strtoull and avoid PR #56293

Reviewed By: efriedma

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


# 3d6c10dc 19-Jul-2022 Sanjay Patel <[email protected]>

[SimplifyLibCalls] avoid converting pow() to powi() with no FMF

powi() is not a standard math library function; it is specified
with non-strict semantics in the LangRef. We currently require
'afn' t

[SimplifyLibCalls] avoid converting pow() to powi() with no FMF

powi() is not a standard math library function; it is specified
with non-strict semantics in the LangRef. We currently require
'afn' to do this transform when it needs a sqrt(), so I just
extended that requirement to the whole-number exponent too.

This bug was introduced with:
b17754bcaa14
...where we deferred expansion of pow() to later passes.

show more ...


# ab7ee3c9 13-Jul-2022 Martin Sebor <[email protected]>

[InstCombine] Enable strtol folding with nonnull endptr

Reviewed By: nikic

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


# b17754bc 09-Jul-2022 Paul Osmialowski <[email protected]>

[SimplifyLibCalls] refactor pow(x, n) expansion where n is a constant integer value

Since the backend's codegen is capable to expand powi into fmul's, it
is not needed anymore to do so in the ::opti

[SimplifyLibCalls] refactor pow(x, n) expansion where n is a constant integer value

Since the backend's codegen is capable to expand powi into fmul's, it
is not needed anymore to do so in the ::optimizePow() function of
SimplifyLibCalls.cpp. What is sufficient is to always turn pow(x, n)
into powi(x, n) for the cases where n is a constant integer value.

Dropping the current expansion code allowed relaxation of the folding
conditions and now this can also happen at optimization levels below
Ofast.

The added CodeGen/AArch64/powi.ll test case ensures that powi is
actually expanded into fmul's, confirming that this refactor did not
cause any performance degradation.

Following an idea proposed by David Sherwood <[email protected]>.

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

show more ...


# 516915be 30-Jun-2022 Martin Sebor <[email protected]>

[InstCombine] Fold memchr and strchr equality with first argument

Enhance memchr and strchr handling to simplify calls to the functions
used in equality expressions with the first argument to at mos

[InstCombine] Fold memchr and strchr equality with first argument

Enhance memchr and strchr handling to simplify calls to the functions
used in equality expressions with the first argument to at most two
integer comparisons:

- memchr(A, C, N) == A to N && *A == C for either a dereferenceable
A or a nonzero N,
- strchr(S, C) == S to *S == C for any S and C, and
- strchr(S, '\0') == 0 to true for any S

Reviewed By: nikic

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

show more ...


# 0d68ff87 01-Jul-2022 Martin Sebor <[email protected]>

[InstCombine] Transform strrchr to memrchr for constant strings

Add an emitter for the memrchr common extension and simplify the strrchr
call handler to use it. This enables transforming calls with

[InstCombine] Transform strrchr to memrchr for constant strings

Add an emitter for the memrchr common extension and simplify the strrchr
call handler to use it. This enables transforming calls with the empty
string to the test C ? S : 0.

Reviewed By: nikic

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

show more ...


# fabe9157 01-Jul-2022 Nikita Popov <[email protected]>

[SimplifyLibCalls] Use inbounds GEP

When converting strchr(p, '\0') to p + strlen(p) we know that
strlen() must return an offset that is inbounds of the allocated
object (otherwise it would be UB),

[SimplifyLibCalls] Use inbounds GEP

When converting strchr(p, '\0') to p + strlen(p) we know that
strlen() must return an offset that is inbounds of the allocated
object (otherwise it would be UB), so we can use an inbounds GEP.
An equivalent argument can be made for the other cases.

show more ...


# 3a743a58 30-Jun-2022 Martin Sebor <[email protected]>

[InstCombine] Fix memrchr logic error that prevents folding

Correct a logic bug in the memrchr enhancement added in D123629 that
makes it ineffective in a subset of cases.

Reviewed By: nikic

Diffe

[InstCombine] Fix memrchr logic error that prevents folding

Correct a logic bug in the memrchr enhancement added in D123629 that
makes it ineffective in a subset of cases.

Reviewed By: nikic

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

show more ...


# 88276798 28-Jun-2022 Martin Sebor <[email protected]>

[InstCombine] Fold strncmp of constant arrays and variable size

Extend the solution accepted in D127766 to strncmp and simplify
strncmp(A, B, N) calls with constant A and B and variable N to
the equ

[InstCombine] Fold strncmp of constant arrays and variable size

Extend the solution accepted in D127766 to strncmp and simplify
strncmp(A, B, N) calls with constant A and B and variable N to
the equivalent of

N <= Pos ? 0 : (A < B ? -1 : B < A ? +1 : 0)

where Pos is the offset of either the first mismatch between A
and B or the terminating null character if both A and B are equal
strings.

Reviewed By: courbet

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

show more ...


# e263a767 28-Jun-2022 Martin Sebor <[email protected]>

[InstCombine] Look through more casts when folding memchr and memcmp

Enhance getConstantDataArrayInfo to let the memchr and memcmp library
call folders look through arbitrarily long sequences of bit

[InstCombine] Look through more casts when folding memchr and memcmp

Enhance getConstantDataArrayInfo to let the memchr and memcmp library
call folders look through arbitrarily long sequences of bitcast and
GEP instructions.

Reviewed By: nikic

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

show more ...


Revision tags: llvmorg-14.0.6
# b19194c0 21-Jun-2022 Martin Sebor <[email protected]>

[InstCombine] handle subobjects of constant aggregates

Remove the known limitation of the library function call folders to only
work with top-level arrays of characters (as per the TODO comment in
t

[InstCombine] handle subobjects of constant aggregates

Remove the known limitation of the library function call folders to only
work with top-level arrays of characters (as per the TODO comment in
the code) and allows them to also fold calls involving subobjects of
constant aggregates such as member arrays.

show more ...


# 5fb67e32 17-Jun-2022 Martin Sebor <[email protected]>

[InstCombine] Fold memcmp of constant arrays and variable size

The memcmp simplifier is limited to folding to constants calls with constant
arrays and constant sizes. This change adds the ability t

[InstCombine] Fold memcmp of constant arrays and variable size

The memcmp simplifier is limited to folding to constants calls with constant
arrays and constant sizes. This change adds the ability to simplify
memcmp(A, B, N) calls with constant A and B and variable N to the pseudocode
equivalent of

N <= Pos ? 0 : (A < B ? -1 : B < A ? +1 : 0)

where Pos is the offset of the first mismatch between A and B.

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

show more ...


# 2dac2c4f 15-Jun-2022 Nikita Popov <[email protected]>

[SimplifyLibCalls] Drop duplicate check (NFC)

The same condition already exists inside optimizeMemCmpConstantSize().


Revision tags: llvmorg-14.0.5
# dd2a6d78 07-Jun-2022 Martin Sebor <[email protected]>

[InstCombine] Fold memchr of sequences of same characters

Enhance memchr libcall folder to handle constant arrays consisting
of one or two sequences of cosecutive equal characters.

Reviewed By: nik

[InstCombine] Fold memchr of sequences of same characters

Enhance memchr libcall folder to handle constant arrays consisting
of one or two sequences of cosecutive equal characters.

Reviewed By: nikic

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

show more ...


# fb6627fa 07-Jun-2022 Martin Sebor <[email protected]>

[InstCombine] Add substr helper function (NFC).

Reviewed By: nikic

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


# 46c0ec9d 24-May-2022 Martin Sebor <[email protected]>

[InstCombine] Fold memrchr calls with sequences of identical bytes.

Reviewed By: nikic

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


Revision tags: llvmorg-14.0.4
# be7f09f7 16-May-2022 Sanjay Patel <[email protected]>

[IR] create and use helper functions that test the signbit; NFCI


Revision tags: llvmorg-14.0.3, llvmorg-14.0.2
# 304378fd 20-Apr-2022 Jonas Paulsson <[email protected]>

Reapply "[BuildLibCalls] Introduce getOrInsertLibFunc() for use when building
libcalls." (was 0f8c626). This reverts commit 14d9390.

The patch previously failed to recognize cases where user had def

Reapply "[BuildLibCalls] Introduce getOrInsertLibFunc() for use when building
libcalls." (was 0f8c626). This reverts commit 14d9390.

The patch previously failed to recognize cases where user had defined a
function alias with an identical name as that of the library
function. Module::getFunction() would then return nullptr which is what the
sanitizer discovered.

In this updated version a new function isLibFuncEmittable() has as well been
introduced which is now used instead of TLI->has() anytime a library function
is to be emitted . It additionally also makes sure there is e.g. no function
alias with the same name in the module.

Reviewed By: Eli Friedman

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

show more ...


# efa0f12c 27-Apr-2022 Martin Sebor <[email protected]>

[InstCombine] Fold strnlen calls in equality to zero.

Reviewed By: nikic

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


# ffed0cfc 26-Apr-2022 Martin Sebor <[email protected]>

[SimplifyLibCalls] avoid slicing 64-bit integers in an ILP32 build (PR #54739)

Reviewed By: nikic

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


# 449adafa 26-Apr-2022 Martin Sebor <[email protected]>

[InstCombine] Fold strnlen of constant strings.

Reviewed By: nikic

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


# ce8f42d4 26-Apr-2022 Martin Sebor <[email protected]>

[InstCombine] Fold memrchr calls with a constant character.

Reviewed By: nikic

Differential Revision: //reviews.llvm.org/D123629


# 10c99ce6 26-Apr-2022 Martin Sebor <[email protected]>

[InstCombine] Fold memrchr calls with constant size, bail on excessive.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123626
Differential Revision: https://reviews.llvm.org/D1

[InstCombine] Fold memrchr calls with constant size, bail on excessive.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123626
Differential Revision: https://reviews.llvm.org/D123628

show more ...


# 25febbd1 26-Apr-2022 Martin Sebor <[email protected]>

[InstCombine] Fold strnlen with a bound of zero and one.

Reviewed By: nikic

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


12345678910>>...18