History log of /llvm-project/clang/lib/CodeGen/CodeGenModule.cpp (Results 26 – 50 of 2157)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# fa789dff 11-Oct-2024 Rahul Joshi <rjoshi@nvidia.com>

[NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (#111752)

Rename the function to reflect its correct behavior and to be consistent
with `Module::getOrInsertFunction`. This is a

[NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (#111752)

Rename the function to reflect its correct behavior and to be consistent
with `Module::getOrInsertFunction`. This is also in preparation of
adding a new `Intrinsic::getDeclaration` that will have behavior similar
to `Module::getFunction` (i.e, just lookup, no creation).

show more ...


# f658c1bf 08-Oct-2024 Piyou Chen <piyou.chen@sifive.com>

Recommit "[RISCV][FMV] Support target_version" (#111096)" (#111333)

Fix the buildbot failure caused by heap use-after-free error.

Origin message:

This patch enable `target_version` attribu

Recommit "[RISCV][FMV] Support target_version" (#111096)" (#111333)

Fix the buildbot failure caused by heap use-after-free error.

Origin message:

This patch enable `target_version` attribute for RISC-V target.

The proposal of `target_version` syntax can be found at the
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/48 (which has
landed), as modified by the proposed
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85 (which adds the
priority syntax).

`target_version` attribute will trigger the function multi-versioning
feature and act like `target_clones` attribute. See
https://github.com/llvm/llvm-project/pull/85786 for the implementation
of `target_clones`.

show more ...


# 1e5e1534 04-Oct-2024 Piyou Chen <piyou.chen@sifive.com>

Revert "[RISCV][FMV] Support target_version" (#111096)

Reverts llvm/llvm-project#99040 due to https://lab.llvm.org/buildbot/#/builders/190/builds/7052


# 7ab488e9 04-Oct-2024 Piyou Chen <piyou.chen@sifive.com>

[RISCV][FMV] Support target_version (#99040)

This patch enable `target_version` attribute for RISC-V target.

The proposal of `target_version` syntax can be found at the
https://github.com/riscv-

[RISCV][FMV] Support target_version (#99040)

This patch enable `target_version` attribute for RISC-V target.

The proposal of `target_version` syntax can be found at the
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/48 (which has
landed), as modified by the proposed
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85 (which adds the
priority syntax).

`target_version` attribute will trigger the function multi-versioning
feature and act like `target_clones` attribute. See
https://github.com/llvm/llvm-project/pull/85786 for the implementation
of `target_clones`.

show more ...


Revision tags: llvmorg-19.1.1
# e203a67f 29-Sep-2024 Alex Voicu <alexandru.voicu@amd.com>

[cuda][HIP] `__constant__` should imply constant (#110182)

Currently, `__constant__` variables do not get unconditionally marked as
`constant` in IR, which seems a bit odd given their definition. T

[cuda][HIP] `__constant__` should imply constant (#110182)

Currently, `__constant__` variables do not get unconditionally marked as
`constant` in IR, which seems a bit odd given their definition. This is
generally inconsequential for NVPTX/AMDGPU, since said variables get
emitted in the constant address space for those BEs. However, it is
potentially significant for e.g. HIP-on-SPIR-V cases, as SPIR-V does not
allow casts to/from the constant AS (`UniformConstant`), which forces
`__constant__` variables to be emitted in the global AS, thus making IR
constness meaningful.

show more ...


# 9f33eb86 26-Sep-2024 Ming-Yi Lai <ming-yi.lai@mediatek.com>

[clang][RISCV] Introduce command line options for RISC-V Zicfilp CFI

This patch enables the following command line flags for RISC-V targets:

+ `-fcf-protection=branch` turns on forward-edge contr

[clang][RISCV] Introduce command line options for RISC-V Zicfilp CFI

This patch enables the following command line flags for RISC-V targets:

+ `-fcf-protection=branch` turns on forward-edge control-flow integrity conditioning
+ `-mcf-branch-label-scheme=unlabeled|func-sig` selects the label scheme used in the forward-edge CFI conditioning

show more ...


# eca59490 23-Sep-2024 Congcong Cai <congcongcai0907@163.com>

[codegen][NFC] add static mark for internal usage variable and function (#109431)

Detect by clang-tidy misc-use-internal-linkage


# b89bb777 17-Sep-2024 Thurston Dang <thurston@google.com>

Reapply "[HLSL] set alwaysinline on HLSL functions (#106588)"

This reverts commit 4a63f4d301c0e044073e1b1f8f110015ec1778a1.

It was reverted because of a buildbot breakage, but the fix-forward has
l

Reapply "[HLSL] set alwaysinline on HLSL functions (#106588)"

This reverts commit 4a63f4d301c0e044073e1b1f8f110015ec1778a1.

It was reverted because of a buildbot breakage, but the fix-forward has
landed (https://github.com/llvm/llvm-project/pull/109023).

show more ...


# 4a63f4d3 17-Sep-2024 Thurston Dang <thurston@google.com>

Revert "[HLSL] set alwaysinline on HLSL functions (#106588)"

This reverts commit a729e706de3fc6ebee49ede3c50afb47f2e29191.

Reason:bBuildbot failure (https://lab.llvm.org/buildbot/#/builders/25/buil

Revert "[HLSL] set alwaysinline on HLSL functions (#106588)"

This reverts commit a729e706de3fc6ebee49ede3c50afb47f2e29191.

Reason:bBuildbot failure (https://lab.llvm.org/buildbot/#/builders/25/builds/2541):
'Clang :: CodeGenHLSL/builtins/StructuredBuffer-subscript.hlsl' failed

show more ...


# a729e706 17-Sep-2024 Greg Roth <grroth@microsoft.com>

[HLSL] set alwaysinline on HLSL functions (#106588)

HLSL inlines all its functions by default. This uses the alwaysinline
attribute to make the alwaysinliner pass inline any function not
explicitl

[HLSL] set alwaysinline on HLSL functions (#106588)

HLSL inlines all its functions by default. This uses the alwaysinline
attribute to make the alwaysinliner pass inline any function not
explicitly marked noinline by the user or autogeneration. The
alwayslinline marking takes place in `SetLLVMFunctionAttributesForDefinitions`
where all other inlining interactions are determined.

The outermost entry function is marked noinline because there's no
reason to inline it. Any user calls to an entry function will instead call
the internal mangled version of the entry function.

Adds tests for function and constructor inlining and augments some
existing tests to verify correct inlining of implicitly created
functions as well.

Incidentally restore RUN line that I believe was mistakenly removed as
part of #88918

Fixes #89282

show more ...


Revision tags: llvmorg-19.1.0
# 9cd93774 13-Sep-2024 Piyou Chen <piyou.chen@sifive.com>

[RISCV][FMV] Support target_clones (#85786)

This patch enable the function multiversion(FMV) and `target_clones`
attribute for RISC-V target.

The proposal of `target_clones` syntax can be found

[RISCV][FMV] Support target_clones (#85786)

This patch enable the function multiversion(FMV) and `target_clones`
attribute for RISC-V target.

The proposal of `target_clones` syntax can be found at the
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/48 (which has
landed), as modified by the proposed
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85 (which adds the
priority syntax).

It supports the `target_clones` function attribute and function
multiversioning feature for RISC-V target. It will generate the ifunc
resolver function for the function that declared with target_clones
attribute.

The resolver function will check the version support by runtime object
`__riscv_feature_bits`.

For example:

```
__attribute__((target_clones("default", "arch=+ver1", "arch=+ver2"))) int bar() {
return 1;
}
```

the corresponding resolver will be like:

```
bar.resolver() {
__init_riscv_feature_bits();
// Check arch=+ver1
if ((__riscv_feature_bits.features[0] & BITMASK_OF_VERSION1) == BITMASK_OF_VERSION1) {
return bar.arch=+ver1;
} else {
// Check arch=+ver2
if ((__riscv_feature_bits.features[0] & BITMASK_OF_VERSION2) == BITMASK_OF_VERSION2) {
return bar.arch=+ver2;
} else {
// Default
return bar.default;
}
}
}
```

show more ...


# becb03f3 10-Sep-2024 Helena Kotas <hekotas@microsoft.com>

[DirectX] Add DirectXTargetCodeGenInfo (#104856)

Adds target codegen info class for DirectX. For now it always translates
`__hlsl_resource_t` handle to `target("dx.TypedBuffer", i32, 1, 0, 1)`
(`R

[DirectX] Add DirectXTargetCodeGenInfo (#104856)

Adds target codegen info class for DirectX. For now it always translates
`__hlsl_resource_t` handle to `target("dx.TypedBuffer", i32, 1, 0, 1)`
(`RWBuffer<int>`). More work is needed to determine the actual target
exp type and parameters based on the resource handle attributes.

Part 1/2 of #95952

show more ...


Revision tags: llvmorg-19.1.0-rc4
# 73e0aa58 28-Aug-2024 Jessica Clarke <jrtc27@jrtc27.com>

[CodeGen] Create IFUNCs in the program address space, not hard-coded 0 (#105726)

Commit 0d527e56a5ee ("GlobalIFunc: Make ifunc respect function address
spaces") added support for this within LLVM,

[CodeGen] Create IFUNCs in the program address space, not hard-coded 0 (#105726)

Commit 0d527e56a5ee ("GlobalIFunc: Make ifunc respect function address
spaces") added support for this within LLVM, but Clang does not properly
honour the target's address spaces when creating IFUNCs, crashing with
RAUW and verifier assertion failures when compiling C code on a target
with a non-zero program address space, so fix this.

show more ...


# 6c62ad44 21-Aug-2024 Vassil Vassilev <v.g.vassilev@gmail.com>

[clang-repl] [codegen] Reduce the state in TBAA. NFC for static compilation. (#98138)

In incremental compilation clang works with multiple `llvm::Module`s.
Our current approach is to create a CodeG

[clang-repl] [codegen] Reduce the state in TBAA. NFC for static compilation. (#98138)

In incremental compilation clang works with multiple `llvm::Module`s.
Our current approach is to create a CodeGenModule entity for every new
module request (via StartModule). However, some of the state such as the
mangle context needs to be preserved to keep the original semantics in
the ever-growing TU.

Fixes: llvm/llvm-project#95581.

cc: @jeaye

show more ...


# e1c36bde 20-Aug-2024 Sami Tolvanen <samitolvanen@users.noreply.github.com>

Fix KCFI types for generated functions with integer normalization (#104826)

With -fsanitize-cfi-icall-experimental-normalize-integers, Clang
appends ".normalized" to KCFI types in CodeGenModule::Cr

Fix KCFI types for generated functions with integer normalization (#104826)

With -fsanitize-cfi-icall-experimental-normalize-integers, Clang
appends ".normalized" to KCFI types in CodeGenModule::CreateKCFITypeId,
which changes type hashes also for functions that don't have integer
types in their signatures. However, llvm::setKCFIType does not take
integer normalization into account, which means LLVM generated
functions with KCFI types, e.g. sanitizer constructors, will fail KCFI
checks when integer normalization is enabled in Clang.

Add a cfi-normalize-integers module flag to indicate integer
normalization is used, and append ".normalized" to KCFI types also in
llvm::setKCFIType to fix the type mismatch.

show more ...


Revision tags: llvmorg-19.1.0-rc3
# de5deb7b 19-Aug-2024 Daniil Kovalev <dkovalev@accesssoftek.com>

[PAC][ELF][AArch64] Encode several ptrauth features in PAuth core info (#102508)

For llvm_linux platform, define the following meaning for bits 9, 10,
11:

- bit 9: set if indirect gotos signing

[PAC][ELF][AArch64] Encode several ptrauth features in PAuth core info (#102508)

For llvm_linux platform, define the following meaning for bits 9, 10,
11:

- bit 9: set if indirect gotos signing is enabled;
- bit 10: set if type info vtable pointer discrimination is enabled;
- bit 11: set if function pointer type discrimination is enabled.

show more ...


# 92aec519 09-Aug-2024 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][RemoveDIs] Use iterator-inserters in clang (#102006)

As part of the LLVM effort to eliminate debug-info intrinsics, we're
moving to a world where only iterators should be used to insert

[DebugInfo][RemoveDIs] Use iterator-inserters in clang (#102006)

As part of the LLVM effort to eliminate debug-info intrinsics, we're
moving to a world where only iterators should be used to insert
instructions. This isn't a problem in clang when instructions get
generated before any debug-info is inserted, however we're planning on
deprecating and removing the instruction-pointer insertion routines.

Scatter some calls to getIterator in a few places, remove a
deref-then-addrof on another iterator, and add an overload for the
createLoadInstBefore utility. Some callers passes a null insertion
point, which we need to handle explicitly now.

show more ...


# 15d4a84e 06-Aug-2024 Daniil Kovalev <dkovalev@accesssoftek.com>

[PAC][ELF][AArch64] Encode signed GOT flag in PAuth core info (#96159)

Treat 8th bit of version value for llvm_linux platform as signed GOT
flag.

- clang: define `PointerAuthELFGOT` LangOption a

[PAC][ELF][AArch64] Encode signed GOT flag in PAuth core info (#96159)

Treat 8th bit of version value for llvm_linux platform as signed GOT
flag.

- clang: define `PointerAuthELFGOT` LangOption and set 8th bit of
`aarch64-elf-pauthabi-version` LLVM module flag correspondingly;

- llvm-readobj: print `PointerAuthELFGOT` or `!PointerAuthELFGOT` in
version description of llvm_linux platform depending on whether the flag
is set.

show more ...


# 617cf8a7 06-Aug-2024 Aaron Ballman <aaron@aaronballman.com>

Reapply "Finish deleting the le32/le64 targets" (#99079) (#101983)

This reverts commit d3f8105c65046173e20c4c59394b4a7f1bbe7627.

Halide no longer relies on this target:
https://github.com/llvm/l

Reapply "Finish deleting the le32/le64 targets" (#99079) (#101983)

This reverts commit d3f8105c65046173e20c4c59394b4a7f1bbe7627.

Halide no longer relies on this target:
https://github.com/llvm/llvm-project/pull/98497#issuecomment-2253358685

show more ...


# 6e45fa95 06-Aug-2024 Daniil Kovalev <dkovalev@accesssoftek.com>

[PAC][AArch64] Support init/fini array signing (#96478)

If both `-fptrauth-init-fini` and `-fptrauth-calls` are passed, sign
function pointers in `llvm.global_ctors` and `llvm.global_dtors` with
c

[PAC][AArch64] Support init/fini array signing (#96478)

If both `-fptrauth-init-fini` and `-fptrauth-calls` are passed, sign
function pointers in `llvm.global_ctors` and `llvm.global_dtors` with
constant discriminator 0xD9D4
(`ptrauth_string_discriminator("init_fini")`). Additionally, if
`-fptrauth-init-fini-address-discrimination` is passed, address
discrimination is used for signing (otherwise, just constant
discriminator is used).

For address discrimination, we use it's special form since uses of
`llvm.global_{c|d}tors` are disallowed (see
`Verifier::visitGlobalVariable`) and we can't emit `getelementptr`
expressions referencing these special arrays. A signed ctor/dtor pointer
with special address discrimination applied looks like the following:

```
ptr ptrauth (ptr @foo, i32 0, i64 55764, ptr inttoptr (i64 1 to ptr))
```

show more ...


Revision tags: llvmorg-19.1.0-rc2
# e167f753 01-Aug-2024 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

[C++20] [Modules] Always emit the inline builtins (#101278)

See the attached test for the motivation example. If we're too greedy to
not emit the definition for inline builtins, we may meet a middl

[C++20] [Modules] Always emit the inline builtins (#101278)

See the attached test for the motivation example. If we're too greedy to
not emit the definition for inline builtins, we may meet a middle end
crash. And it should be good to emit inline builtins always.

show more ...


# cf79aba9 31-Jul-2024 smanna12 <soumi.manna@intel.com>

[Clang] [NFC] Fix potential dereferencing of nullptr (#101405)

This patch replaces getAs with castAs and dyn_cast with cast to ensure
type safety and prevents potential null pointer dereferences. T

[Clang] [NFC] Fix potential dereferencing of nullptr (#101405)

This patch replaces getAs with castAs and dyn_cast with cast to ensure
type safety and prevents potential null pointer dereferences. These
changes enforce compile-time checks for correct type casting in
ASTContext and CodeGenModule.

show more ...


# f86ce867 30-Jul-2024 Haowei Wu <haowei@google.com>

Revert "[C++20] [Modules] Always emit the inline builtins"

This reverts commit ca8a4111f796fe8533e0af95557875b15becff06.
This patch broke clang test on Windows x64 msvc


# 243b27f7 30-Jul-2024 Krzysztof Parzyszek <Krzysztof.Parzyszek@amd.com>

[clang][OpenMP] Rename `varlists` to `varlist`, NFC (#101058)

It returns a range of variables (via Expr*), not a range of lists.


# ca8a4111 30-Jul-2024 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

[C++20] [Modules] Always emit the inline builtins

See the attached test for the motivation example. If we're too greedy to
not emit the definition for inline builtins, we may meet a middle end
crash

[C++20] [Modules] Always emit the inline builtins

See the attached test for the motivation example. If we're too greedy to
not emit the definition for inline builtins, we may meet a middle end
crash. And it should be good to emit inline builtins always.

show more ...


12345678910>>...87