<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/Target/LLVMIR/Transforms/TargetToTargetFeatures.cpp, branch main</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>[MLIR][LLVMIR][DLTI] Pass to update #llvm.target's features per relevant backend (#154938)</title>
<updated>2025-08-26T22:12:35+00:00</updated>
<author>
<name>Rolf Morel</name>
<email>rolf.morel@intel.com</email>
</author>
<published>2025-08-26T22:12:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4b84223aad4fb5f277aa524b6ff518f4e1cd0df7'/>
<id>4b84223aad4fb5f277aa524b6ff518f4e1cd0df7</id>
<content type='text'>
Modifies `#llvm.target&lt;..., features = $FEATURES&gt;` so that `$FEATURES`
is now an `#llvm.target_features&lt;[...]&gt;` attribute (rather than a
`StringAttr`). This enables the attribute to respond to DLTI queries for
the different target features.

The pass updates the `$FEATURES` attribute of the target attr at name
`llvm.target` in accordance with the (Sub)Target's features that the
relevant LLVM backend knows about.

---

DEMO:
```mlir
module attributes {llvm.target = #llvm.target&lt;triple = "x86_64-unknown-linux",
                                              chip = "skylake"&gt; } {
}
```
by way of `-llvm-target-to-target-features` turns into:
```mlir
module attributes {llvm.target = #llvm.target&lt;triple = "x86_64-unknown-linux",
                                              chip = "skylake", 
                                              features = &lt;["+64bit", "+64bit-mode", "+adx", "+aes", "+allow-light-256-bit", "+avx", "+avx2", "+bmi", "+bmi2", "+clflushopt", "+cmov", "+crc32", "+cx16", "+cx8", "+ermsb", "+f16c", "+false-deps-popcnt", "+fast-15bytenop", "+fast-gather", "+fast-scalar-fsqrt", "+fast-shld-rotate", "+fast-variable-crosslane-shuffle", "+fast-variable-perlane-shuffle", "+fast-vector-fsqrt", "+fma", "+fsgsbase", "+fxsr", "+idivq-to-divl", "+invpcid", "+lzcnt", "+macrofusion", "+mmx", "+movbe", "+no-bypass-delay-blend", "+no-bypass-delay-mov", "+no-bypass-delay-shuffle", "+nopl", "+pclmul", "+popcnt", "+prfchw", "+rdrnd", "+rdseed", "+sahf", "+slow-3ops-lea", "+sse", "+sse2", "+sse3", "+sse4.1", "+sse4.2", "+ssse3", "+vzeroupper", "+x87", "+xsave", "+xsavec", "+xsaveopt", "+xsaves"]&gt;&gt;} {
}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modifies `#llvm.target&lt;..., features = $FEATURES&gt;` so that `$FEATURES`
is now an `#llvm.target_features&lt;[...]&gt;` attribute (rather than a
`StringAttr`). This enables the attribute to respond to DLTI queries for
the different target features.

The pass updates the `$FEATURES` attribute of the target attr at name
`llvm.target` in accordance with the (Sub)Target's features that the
relevant LLVM backend knows about.

---

DEMO:
```mlir
module attributes {llvm.target = #llvm.target&lt;triple = "x86_64-unknown-linux",
                                              chip = "skylake"&gt; } {
}
```
by way of `-llvm-target-to-target-features` turns into:
```mlir
module attributes {llvm.target = #llvm.target&lt;triple = "x86_64-unknown-linux",
                                              chip = "skylake", 
                                              features = &lt;["+64bit", "+64bit-mode", "+adx", "+aes", "+allow-light-256-bit", "+avx", "+avx2", "+bmi", "+bmi2", "+clflushopt", "+cmov", "+crc32", "+cx16", "+cx8", "+ermsb", "+f16c", "+false-deps-popcnt", "+fast-15bytenop", "+fast-gather", "+fast-scalar-fsqrt", "+fast-shld-rotate", "+fast-variable-crosslane-shuffle", "+fast-variable-perlane-shuffle", "+fast-vector-fsqrt", "+fma", "+fsgsbase", "+fxsr", "+idivq-to-divl", "+invpcid", "+lzcnt", "+macrofusion", "+mmx", "+movbe", "+no-bypass-delay-blend", "+no-bypass-delay-mov", "+no-bypass-delay-shuffle", "+nopl", "+pclmul", "+popcnt", "+prfchw", "+rdrnd", "+rdseed", "+sahf", "+slow-3ops-lea", "+sse", "+sse2", "+sse3", "+sse4.1", "+sse4.2", "+ssse3", "+vzeroupper", "+x87", "+xsave", "+xsavec", "+xsaveopt", "+xsaves"]&gt;&gt;} {
}
```</pre>
</div>
</content>
</entry>
</feed>
