History log of /llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (Results 26 – 50 of 2094)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 19c84758 31-Oct-2024 Antonio Frighetto <me@antoniofrighetto.com>

[SelectionDAG] Add preliminary plumbing for `samesign` flag

Extend recently-added poison-generating IR flag to codegen as well.


# cf9d1c14 31-Oct-2024 Yingwei Zheng <dtcxzyw2333@gmail.com>

[SDAG] Simplify `SDNodeFlags` with bitwise logic (#114061)

This patch allows using enumeration values directly and simplifies the
implementation with bitwise logic. It addresses the comment in
htt

[SDAG] Simplify `SDNodeFlags` with bitwise logic (#114061)

This patch allows using enumeration values directly and simplifies the
implementation with bitwise logic. It addresses the comment in
https://github.com/llvm/llvm-project/pull/113808#discussion_r1819923625.

show more ...


# c3260c65 29-Oct-2024 Benjamin Maxwell <benjamin.maxwell@arm.com>

[IR] Add `llvm.sincos` intrinsic (#109825)

This adds the `llvm.sincos` intrinsic, legalization, and lowering.

The `llvm.sincos` intrinsic takes a floating-point value and returns
both the sine a

[IR] Add `llvm.sincos` intrinsic (#109825)

This adds the `llvm.sincos` intrinsic, legalization, and lowering.

The `llvm.sincos` intrinsic takes a floating-point value and returns
both the sine and cosine (as a struct).

```
declare { float, float } @llvm.sincos.f32(float %Val)
declare { double, double } @llvm.sincos.f64(double %Val)
declare { x86_fp80, x86_fp80 } @llvm.sincos.f80(x86_fp80 %Val)
declare { fp128, fp128 } @llvm.sincos.f128(fp128 %Val)
declare { ppc_fp128, ppc_fp128 } @llvm.sincos.ppcf128(ppc_fp128 %Val)
declare { <4 x float>, <4 x float> } @llvm.sincos.v4f32(<4 x float> %Val)
```

The lowering is built on top of the existing FSINCOS ISD node, with
additional type legalization to allow for f16, f128, and vector values.

show more ...


Revision tags: llvmorg-19.1.3
# 44b020a3 18-Oct-2024 Keith Packard <keithp@keithp.com>

[PowerPC][ISelLowering] Support -mstack-protector-guard=tls (#110928)

Add support for using a thread-local variable with a specified offset
for holding the stack guard canary value. This supports b

[PowerPC][ISelLowering] Support -mstack-protector-guard=tls (#110928)

Add support for using a thread-local variable with a specified offset
for holding the stack guard canary value. This supports both 32- and 64-
bit PowerPC targets.

This mirrors changes from #108942 but targeting PowerPC instead of
RISCV. Because both of these PRs modify the same driver functions, this
series is stack on top of the RISC-V one.

---------

Signed-off-by: Keith Packard <keithp@keithp.com>

show more ...


# 255a99c2 17-Oct-2024 Nikita Popov <npopov@redhat.com>

[APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (#80309)

This fixes all the places that hit the new assertion added in
https://github.com/llvm/llvm-project/pull/106524 in t

[APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (#80309)

This fixes all the places that hit the new assertion added in
https://github.com/llvm/llvm-project/pull/106524 in tests. That is,
cases where the value passed to the APInt constructor is not an N-bit
signed/unsigned integer, where N is the bit width and signedness is
determined by the isSigned flag.

The fixes either set the correct value for isSigned, set the
implicitTrunc flag, or perform more calculations inside APInt.

Note that the assertion is currently still disabled by default, so this
patch is mostly NFC.

show more ...


# 875afa93 16-Oct-2024 Tex Riddell <texr@microsoft.com>

[X86][CodeGen] Add base atan2 intrinsic lowering (p4) (#110760)

This change is part of this proposal:
https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294

Based on example PR #96222 an

[X86][CodeGen] Add base atan2 intrinsic lowering (p4) (#110760)

This change is part of this proposal:
https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294

Based on example PR #96222 and fix PR #101268, with some differences due
to 2-arg intrinsic and intermediate refactor (RuntimeLibCalls.cpp).

- Add llvm.experimental.constrained.atan2 - Intrinsics.td,
ConstrainedOps.def, LangRef.rst
- Add to ISDOpcodes.h and TargetSelectionDAG.td, connect to intrinsic in
BasicTTIImpl.h, and LibFunc_ in SelectionDAGBuilder.cpp
- Update LegalizeDAG.cpp, LegalizeFloatTypes.cpp, LegalizeVectorOps.cpp,
and LegalizeVectorTypes.cpp
- Update isKnownNeverNaN in SelectionDAG.cpp
- Update SelectionDAGDumper.cpp
- Update libcalls - RuntimeLibcalls.def, RuntimeLibcalls.cpp
- TargetLoweringBase.cpp - Expand for vectors, promote f16
- X86ISelLowering.cpp - Expand f80, promote f32 to f64 for MSVC

Part 4 for Implement the atan2 HLSL Function #70096.

show more ...


Revision tags: llvmorg-19.1.2
# 464a7ee7 13-Oct-2024 duk <74797529+duk-37@users.noreply.github.com>

[CodeGen] Generalize trap emission after SP check fail (#109744)

Generalize and improve some target-specific code that emits traps after
stack protector failure in SelectionDAG & GlobalIsel.


# ced15cd4 09-Oct-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

DAG: Preserve more flags when expanding gep (#110815)

This allows selecting the addressing mode for stack instructions
in cases where we need to prove the sign bit is zero.


Revision tags: llvmorg-19.1.1
# e03f4271 19-Sep-2024 Jay Foad <jay.foad@amd.com>

[LLVM] Use {} instead of std::nullopt to initialize empty ArrayRef (#109133)

It is almost always simpler to use {} instead of std::nullopt to
initialize an empty ArrayRef. This patch changes all oc

[LLVM] Use {} instead of std::nullopt to initialize empty ArrayRef (#109133)

It is almost always simpler to use {} instead of std::nullopt to
initialize an empty ArrayRef. This patch changes all occurrences I could
find in LLVM itself. In future the ArrayRef(std::nullopt_t) constructor
could be deprecated or removed.

show more ...


# 14120227 19-Sep-2024 Jonas Paulsson <paulson1@linux.ibm.com>

Target ABI: improve call parameters extensions handling (#100757)

For the purpose of verifying proper arguments extensions per the target's ABI,
introduce the NoExt attribute that may be used by a

Target ABI: improve call parameters extensions handling (#100757)

For the purpose of verifying proper arguments extensions per the target's ABI,
introduce the NoExt attribute that may be used by a target when neither sign-
or zeroextension is required (e.g. with a struct in register). The purpose of
doing so is to be able to verify that there is always one of these attributes
present and by this detecting cases where sign/zero extension is actually
missing.

As a first step, this patch has the verification step done for the SystemZ
backend only, but left off by default until all known issues have been
addressed.

Other targets/front-ends can now also add NoExt attribute where needed and do
this check in the backend.

show more ...


# 292ee93a 18-Sep-2024 Craig Topper <craig.topper@sifive.com>

[CodeGen] Use Register in SwitchLoweringUtils. NFC (#109092)

Use an empty Register() instead of -1U.


# 9d3ab1c3 18-Sep-2024 Craig Topper <craig.topper@sifive.com>

[SelectionDAGBuilder] Use Register in more places. NFC"


# fe012bd5 18-Sep-2024 Craig Topper <craig.topper@sifive.com>

[SelectionDAG] Use Register around RegisterSDNode related functions. NFC

RegisterSDNode itself already stored a Register.


Revision tags: llvmorg-19.1.0
# 4af249fe 06-Sep-2024 anjenner <161845516+anjenner@users.noreply.github.com>

Add usub_cond and usub_sat operations to atomicrmw (#105568)

These both perform conditional subtraction, returning the minuend and
zero respectively, if the difference is negative.


Revision tags: llvmorg-19.1.0-rc4
# 44cfbef1 02-Sep-2024 Sam Tebbs <samuel.tebbs@arm.com>

[AArch64] Lower partial add reduction to udot or svdot (#101010)

This patch introduces lowering of the partial add reduction intrinsic to
a udot or svdot for AArch64. This also involves adding a
`

[AArch64] Lower partial add reduction to udot or svdot (#101010)

This patch introduces lowering of the partial add reduction intrinsic to
a udot or svdot for AArch64. This also involves adding a
`shouldExpandPartialReductionIntrinsic` target hook, which AArch64 will
return false from in the cases that it can be lowered.

show more ...


# e9eaf19e 29-Aug-2024 Dávid Ferenc Szabó <30732159+dfszabo@users.noreply.github.com>

[CodeGen] Allow mixed scalar type constraints for inline asm (#65465)

GCC supports code like "asm volatile ("" : "=r" (i) : "0" (f))" where i
is integer type and f is floating point type. Currently

[CodeGen] Allow mixed scalar type constraints for inline asm (#65465)

GCC supports code like "asm volatile ("" : "=r" (i) : "0" (f))" where i
is integer type and f is floating point type. Currently this code
produces an error with Clang. The change allows mixed scalar types
between input and output constraints.

Co-authored-by: Matt Arsenault <Matthew.Arsenault@amd.com>

show more ...


# 3d08ade7 29-Aug-2024 Stephen Tozer <stephen.tozer@sony.com>

[ExtendLifetimes] Implement llvm.fake.use to extend variable lifetimes (#86149)

This patch is part of a set of patches that add an `-fextend-lifetimes`
flag to clang, which extends the lifetimes of

[ExtendLifetimes] Implement llvm.fake.use to extend variable lifetimes (#86149)

This patch is part of a set of patches that add an `-fextend-lifetimes`
flag to clang, which extends the lifetimes of local variables and
parameters for improved debuggability. In addition to that flag, the
patch series adds a pragma to selectively disable `-fextend-lifetimes`,
and an `-fextend-this-ptr` flag which functions as `-fextend-lifetimes`
for this pointers only. All changes and tests in these patches were
written by Wolfgang Pieb (@wolfy1961), while Stephen Tozer (@SLTozer)
has handled review and merging. The extend lifetimes flag is intended to
eventually be set on by `-Og`, as discussed in the RFC
here:

https://discourse.llvm.org/t/rfc-redefine-og-o1-and-add-a-new-level-of-og/72850

This patch implements a new intrinsic instruction in LLVM,
`llvm.fake.use` in IR and `FAKE_USE` in MIR, that takes a single operand
and has no effect other than "using" its operand, to ensure that its
operand remains live until after the fake use. This patch does not emit
fake uses anywhere; the next patch in this sequence causes them to be
emitted from the clang frontend, such that for each variable (or this) a
fake.use operand is inserted at the end of that variable's scope, using
that variable's value. This patch covers everything post-frontend, which
is largely just the basic plumbing for a new intrinsic/instruction,
along with a few steps to preserve the fake uses through optimizations
(such as moving them ahead of a tail call or translating them through
SROA).

Co-authored-by: Stephen Tozer <stephen.tozer@sony.com>

show more ...


# 7b7b0b95 29-Aug-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

DAG: Check if is_fpclass is custom, instead of isLegalOrCustom (#105577)

For some reason, isOperationLegalOrCustom is not the same as
isOperationLegal || isOperationCustom. Unfortunately, it checks

DAG: Check if is_fpclass is custom, instead of isLegalOrCustom (#105577)

For some reason, isOperationLegalOrCustom is not the same as
isOperationLegal || isOperationCustom. Unfortunately, it checks
if the type is legal which makes it uesless for custom lowering
on non-legal types (which is always ppcf128).

Really the DAG builder shouldn't be going to expand this in the
builder, it makes it difficult to work with. It's only here to work
around the DAG requiring legal integer types the same size as
the FP type after type legalization.

show more ...


# 41b55071 28-Aug-2024 Changpeng Fang <changpeng.fang@amd.com>

DAG: Change round-mode operand type to i32 for FPTRUNC_ROUND (#106424)

We need this immediate type to be consistent. This is the pre-commit for
https://github.com/llvm/llvm-project/pull/105761


# 95d2d1cb 28-Aug-2024 Maciej Gabka <maciej.gabka@arm.com>

Move stepvector intrinsic out of experimental namespace (#98043)

This patch is moving out stepvector intrinsic from the experimental
namespace.

This intrinsic exists in LLVM for several years no

Move stepvector intrinsic out of experimental namespace (#98043)

This patch is moving out stepvector intrinsic from the experimental
namespace.

This intrinsic exists in LLVM for several years now, and is widely used.

show more ...


Revision tags: llvmorg-19.1.0-rc3
# 7f87b5bf 19-Aug-2024 Tianqing Wang <tianqing.wang@intel.com>

[SelectionDAG][X86] Preserve unpredictable metadata for conditional branches in SelectionDAG, as well as JCCs generated by X86 backend. (#102101)

This builds on 09515f2c2, which preserves unpredicta

[SelectionDAG][X86] Preserve unpredictable metadata for conditional branches in SelectionDAG, as well as JCCs generated by X86 backend. (#102101)

This builds on 09515f2c2, which preserves unpredictable metadata in
CodeGen for `select`. This patch does it for conditional branches.

show more ...


# 067f2e9f 17-Aug-2024 Craig Topper <craig.topper@sifive.com>

[SelectionDAG] Use getSignedConstant/getAllOnesConstant.


# 3e7ca5f1 16-Aug-2024 Kevin McAfee <kmcafee@nvidia.com>

[SDAG] Read-only intrinsics must have WillReturn and !Throws attributes to be treated as loads (#99999)

This change avoids deleting `!willReturn` intrinsics for which the
return value is unused whe

[SDAG] Read-only intrinsics must have WillReturn and !Throws attributes to be treated as loads (#99999)

This change avoids deleting `!willReturn` intrinsics for which the
return value is unused when building the SDAG. Currently, calls to
read-only intrinsics not marked with `IntrWillReturn` cannot be deleted
at the LLVM IR level but may be deleted when building the SDAG.
These calls are unsafe to remove from the IR because the functions are
`!willReturn` and should also be unsafe to remove fromthe SDAG for
the same reason. This change aligns the behavior of the SDAG to that
of LLVM IR. This change also requires that intrinsics not have the
`Throws` attribute to be treated as loads for the same reason.

show more ...


# 7afb51e0 16-Aug-2024 Craig Topper <craig.topper@sifive.com>

[SelectionDAG][X86] Add SelectionDAG::getSignedConstant and use it in a few places. (#104555)

PR #80309 proposes to have users of APInt's uint64_t
constructor opt-in to implicit truncation. Current

[SelectionDAG][X86] Add SelectionDAG::getSignedConstant and use it in a few places. (#104555)

PR #80309 proposes to have users of APInt's uint64_t
constructor opt-in to implicit truncation. Currently, that patch
requires SelectionDAG::getConstant to opt-in.

This patch adds getSignedConstant so we can start fixing some of the
cases that require implicit truncation.

show more ...


# fb9e685f 15-Aug-2024 YunQiang Su <syq@debian.org>

Intrinsic: introduce minimumnum and maximumnum for IR and SelectionDAG (#96649)

C23 introduced new functions fminimum_num and fmaximum_num, and they
follow the minimumNumber and maximumNumber of IE

Intrinsic: introduce minimumnum and maximumnum for IR and SelectionDAG (#96649)

C23 introduced new functions fminimum_num and fmaximum_num, and they
follow the minimumNumber and maximumNumber of IEEE754-2019. Let's
introduce new intrinsics to support them.

This patch introduces support only support for scalar values. The
support of
vector (vp, vp.reduce, vector.reduce),
experimental.constrained
will be added in future patches.

With this patch, MIPSr6 and LoongArch can work out of box with
fcanonical and fmax/fmin.

Aarch64/PowerPC64 can use the same login as MIPSr6 and LoongArch, while
they have no fcanonical support yet.
I will add it in future patches.

The FMIN/FMAX of RISC-V instructions follows the
minimumNumber/maximumNumber of IEEE754-2019. We can just add it in
future patch.

Background

https://discourse.llvm.org/t/rfc-fix-llvm-min-f-and-llvm-max-f-intrinsics/79735
Currently we have fminnum/fmaxnum, which have different behavior on
different platform for NUM vs sNaN:
1) Fallback to fmin(3)/fmax(3): return qNaN.
2) ARM64/ARM32+Neon: same as libc.
3) MIPSr6/LoongArch/RISC-V: return NUM.

And the fix of fminnum/fmaxnum to follow minNUM/maxNUM of IEEE754-2008
will submit as separated patches.

show more ...


12345678910>>...84