<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp, branch users/mingmingl-llvm/samplefdo-profile-format</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[DirectX] Fix the writing of ConstantExpr GEPs to DXIL bitcode (#154446)</title>
<updated>2025-08-26T17:01:59+00:00</updated>
<author>
<name>Deric C.</name>
<email>cheung.deric@gmail.com</email>
</author>
<published>2025-08-26T17:01:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=13a634281fb080ab0641998eb336ee591631beff'/>
<id>13a634281fb080ab0641998eb336ee591631beff</id>
<content type='text'>
Fixes #153304

Changes:
- When writing `ConstantExpr` GEPs to DXIL bitcode, the bitcode writer
will use the old Constant Code `CST_CODE_CE_GEP_OLD = 12` instead of the
newer `CST_CODE_CE_GEP = 32` which is interpreted as an undef in DXIL.
Additional context: [CST_CODE_CE_GEP = 12 in
DXC](https://github.com/microsoft/DirectXShaderCompiler/blob/0c9e75e7e91bb18fab101abc81d399a0296f499e/include/llvm/Bitcode/LLVMBitCodes.h#L187)
while the same constant code is labeled [CST_CODE_CE_GEP_OLD in
LLVM](https://github.com/llvm/llvm-project/blob/65de318d186c815f43b892aa20b98c50f22ab6fe/llvm/include/llvm/Bitcode/LLVMBitCodes.h#L411)
- Modifies the `PointerTypeAnalysis` to be able to analyze pointer-typed
constants that appear in the operands of instructions so that the
correct type of the `ConstantExpr` GEP is determined and written into
the DXIL bitcode.
- Adds a `PointerTypeAnalysis` test and dxil-dis test to ensure that the
pointer type of `ConstantExpr` GEPs are resolved and `ConstantExpr` GEPs
are written to DXIL bitcode correctly

In addition, this PR also adds a missing call to
`GV.removeDeadConstantUsers()` in the DXILFinalizeLinkage pass, and
removes an unnecessary manual removal of a ConstantExpr in the
DXILFlattenArrays pass.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #153304

Changes:
- When writing `ConstantExpr` GEPs to DXIL bitcode, the bitcode writer
will use the old Constant Code `CST_CODE_CE_GEP_OLD = 12` instead of the
newer `CST_CODE_CE_GEP = 32` which is interpreted as an undef in DXIL.
Additional context: [CST_CODE_CE_GEP = 12 in
DXC](https://github.com/microsoft/DirectXShaderCompiler/blob/0c9e75e7e91bb18fab101abc81d399a0296f499e/include/llvm/Bitcode/LLVMBitCodes.h#L187)
while the same constant code is labeled [CST_CODE_CE_GEP_OLD in
LLVM](https://github.com/llvm/llvm-project/blob/65de318d186c815f43b892aa20b98c50f22ab6fe/llvm/include/llvm/Bitcode/LLVMBitCodes.h#L411)
- Modifies the `PointerTypeAnalysis` to be able to analyze pointer-typed
constants that appear in the operands of instructions so that the
correct type of the `ConstantExpr` GEP is determined and written into
the DXIL bitcode.
- Adds a `PointerTypeAnalysis` test and dxil-dis test to ensure that the
pointer type of `ConstantExpr` GEPs are resolved and `ConstantExpr` GEPs
are written to DXIL bitcode correctly

In addition, this PR also adds a missing call to
`GV.removeDeadConstantUsers()` in the DXILFinalizeLinkage pass, and
removes an unnecessary manual removal of a ConstantExpr in the
DXILFlattenArrays pass.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[DirectX] Legalize lifetime intrinsics for DXIL" (#149883)</title>
<updated>2025-07-21T19:34:50+00:00</updated>
<author>
<name>Deric C.</name>
<email>cheung.deric@gmail.com</email>
</author>
<published>2025-07-21T19:34:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8f9ed788740fd00836195b30061ad161b2055d8c'/>
<id>8f9ed788740fd00836195b30061ad161b2055d8c</id>
<content type='text'>
Reverts llvm/llvm-project#148003 to fix a DirectX backend build breakage
due to #149310</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#148003 to fix a DirectX backend build breakage
due to #149310</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Legalize lifetime intrinsics for DXIL (#148003)</title>
<updated>2025-07-11T19:26:53+00:00</updated>
<author>
<name>Deric C.</name>
<email>cheung.deric@gmail.com</email>
</author>
<published>2025-07-11T19:26:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fee27b33373c126c2205f49c8fc9b8c9fd2f3dca'/>
<id>fee27b33373c126c2205f49c8fc9b8c9fd2f3dca</id>
<content type='text'>
Fixes #147395

This PR legalizes lifetime intrinsics for DXIL by
- Adding a bitcast for the lifetime intrinsics' pointer operand in
dxil-prepare to ensure it gets cast to an `i8*` when written to DXIL
- Removing the memory attribute from lifetime intrinsics in dxil-prepare
to match DXIL
- Making the DXIL bitcode writer write the base/demangled name of
lifetime intrinsics to the symbol table
- Making lifetime intrinsics an exception to Int64Ops shader flag
analysis (otherwise we get `error: Flags must match usage.` from the
validator)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #147395

This PR legalizes lifetime intrinsics for DXIL by
- Adding a bitcast for the lifetime intrinsics' pointer operand in
dxil-prepare to ensure it gets cast to an `i8*` when written to DXIL
- Removing the memory attribute from lifetime intrinsics in dxil-prepare
to match DXIL
- Making the DXIL bitcode writer write the base/demangled name of
lifetime intrinsics to the symbol table
- Making lifetime intrinsics an exception to Int64Ops shader flag
analysis (otherwise we get `error: Flags must match usage.` from the
validator)</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Update for API change in #139406 (#139470)</title>
<updated>2025-05-11T20:29:07+00:00</updated>
<author>
<name>Justin Bogner</name>
<email>mail@justinbogner.com</email>
</author>
<published>2025-05-11T20:29:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fe141c2426e8e6ddcf78758332a1f14e06d1944d'/>
<id>fe141c2426e8e6ddcf78758332a1f14e06d1944d</id>
<content type='text'>
getAsmString returns StringRef now. Fixes build for the DirectX backend.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
getAsmString returns StringRef now. Fixes build for the DirectX backend.</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Teach getConstraintString to return StringRef (NFC) (#139401)</title>
<updated>2025-05-10T20:00:47+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-10T20:00:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=58014a506dd35df3f24320cf295945ad033d0e8c'/>
<id>58014a506dd35df3f24320cf295945ad033d0e8c</id>
<content type='text'>
With this change, some callers get to use StringRef::starts_with.

I'm planning to teach getAsmString to return StringRef also, but
I'ld like to keep that separate from this patch.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this change, some callers get to use StringRef::starts_with.

I'm planning to teach getAsmString to return StringRef also, but
I'ld like to keep that separate from this patch.</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Fix build break caused by bitcode writer changes (#133770)</title>
<updated>2025-03-31T18:39:20+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>farzonlotfi@microsoft.com</email>
</author>
<published>2025-03-31T18:39:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c1bf5e62877cf3a769886505a687def47cd65e05'/>
<id>c1bf5e62877cf3a769886505a687def47cd65e05</id>
<content type='text'>
commit:
https://github.com/llvm/llvm-project/commit/68947342b75cc71f3ac9041d11db086d8d074336
added a new `writeDIFixedPointType` function.
However, `DIFixedPointType` is not supported in DXIL so we need to add a
fail fast case for this to fix the build.

this change fixes a build break introduced by
https://github.com/llvm/llvm-project/pull/129596</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit:
https://github.com/llvm/llvm-project/commit/68947342b75cc71f3ac9041d11db086d8d074336
added a new `writeDIFixedPointType` function.
However, `DIFixedPointType` is not supported in DXIL so we need to add a
fail fast case for this to fix the build.

this change fixes a build break introduced by
https://github.com/llvm/llvm-project/pull/129596</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Store Triple in Module (NFC) (#129868)</title>
<updated>2025-03-06T09:27:47+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-03-06T09:27:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=979c275097a642e9b96c6b0a12f013c831af3a6e'/>
<id>979c275097a642e9b96c6b0a12f013c831af3a6e</id>
<content type='text'>
The module currently stores the target triple as a string. This means
that any code that wants to actually use the triple first has to
instantiate a Triple, which is somewhat expensive. The change in #121652
caused a moderate compile-time regression due to this. While it would be
easy enough to work around, I think that architecturally, it makes more
sense to store the parsed Triple in the module, so that it can always be
directly queried.

For this change, I've opted not to add any magic conversions between
std::string and Triple for backwards-compatibilty purses, and instead
write out needed Triple()s or str()s explicitly. This is because I think
a decent number of them should be changed to work on Triple as well, to
avoid unnecessary conversions back and forth.

The only interesting part in this patch is that the default triple is
Triple("") instead of Triple() to preserve existing behavior. The former
defaults to using the ELF object format instead of unknown object
format. We should fix that as well.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The module currently stores the target triple as a string. This means
that any code that wants to actually use the triple first has to
instantiate a Triple, which is somewhat expensive. The change in #121652
caused a moderate compile-time regression due to this. While it would be
easy enough to work around, I think that architecturally, it makes more
sense to store the parsed Triple in the module, so that it can always be
directly queried.

For this change, I've opted not to add any magic conversions between
std::string and Triple for backwards-compatibilty purses, and instead
write out needed Triple()s or str()s explicitly. This is because I think
a decent number of them should be changed to work on Triple as well, to
avoid unnecessary conversions back and forth.

The only interesting part in this patch is that the default triple is
Triple("") instead of Triple() to preserve existing behavior. The former
defaults to using the ELF object format instead of unknown object
format. We should fix that as well.</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Fix build breaks (#128556)</title>
<updated>2025-02-24T21:42:15+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>farzonlotfi@microsoft.com</email>
</author>
<published>2025-02-24T21:42:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=df14dbd8750fba7851a3fd8878db3692c20a28d1'/>
<id>df14dbd8750fba7851a3fd8878db3692c20a28d1</id>
<content type='text'>
1. Fix build break caused by #126772 by adding `writeDISubrangeType`
stub to `DXILBitcodeWriter.cpp`
2. Fix build break caused by #128480 by adding implementation of pure
virtual method `TargetSubtargetInfo::getRegisterInfo`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Fix build break caused by #126772 by adding `writeDISubrangeType`
stub to `DXILBitcodeWriter.cpp`
2. Fix build break caused by #128480 by adding implementation of pure
virtual method `TargetSubtargetInfo::getRegisterInfo`</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Convert from nocapture to captures(none) (#123181)</title>
<updated>2025-01-29T15:56:47+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-01-29T15:56:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=29441e4f5fa5f5c7709f7cf180815ba97f611297'/>
<id>29441e4f5fa5f5c7709f7cf180815ba97f611297</id>
<content type='text'>
This PR removes the old `nocapture` attribute, replacing it with the new
`captures` attribute introduced in #116990. This change is
intended to be essentially NFC, replacing existing uses of `nocapture`
with `captures(none)` without adding any new analysis capabilities.
Making use of non-`none` values is left for a followup.

Some notes:
* `nocapture` will be upgraded to `captures(none)` by the bitcode
   reader.
* `nocapture` will also be upgraded by the textual IR reader. This is to
   make it easier to use old IR files and somewhat reduce the test churn in
   this PR.
* Helper APIs like `doesNotCapture()` will check for `captures(none)`.
* MLIR import will convert `captures(none)` into an `llvm.nocapture`
   attribute. The representation in the LLVM IR dialect should be updated
   separately.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR removes the old `nocapture` attribute, replacing it with the new
`captures` attribute introduced in #116990. This change is
intended to be essentially NFC, replacing existing uses of `nocapture`
with `captures(none)` without adding any new analysis capabilities.
Making use of non-`none` values is left for a followup.

Some notes:
* `nocapture` will be upgraded to `captures(none)` by the bitcode
   reader.
* `nocapture` will also be upgraded by the textual IR reader. This is to
   make it easier to use old IR files and somewhat reduce the test churn in
   this PR.
* Helper APIs like `doesNotCapture()` will check for `captures(none)`.
* MLIR import will convert `captures(none)` into an `llvm.nocapture`
   attribute. The representation in the LLVM IR dialect should be updated
   separately.</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Avoid deprecated PointerUnion methods (#122972)</title>
<updated>2025-01-14T21:37:15+00:00</updated>
<author>
<name>Justin Bogner</name>
<email>mail@justinbogner.com</email>
</author>
<published>2025-01-14T21:37:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=31249e27f0f8be16e80b2b574c1f2ce70853ed31'/>
<id>31249e27f0f8be16e80b2b574c1f2ce70853ed31</id>
<content type='text'>
PointerUnion's `is`, `get`, and `dyn_cast` have been deprecated in
favour of using `isa`, `cast`, and `dyn_cast` directly. Migrate these
uses over.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PointerUnion's `is`, `get`, and `dyn_cast` have been deprecated in
favour of using `isa`, `cast`, and `dyn_cast` directly. Migrate these
uses over.</pre>
</div>
</content>
</entry>
</feed>
