<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/147394>147394</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [DirectX] `llvm.lifetime.start/.end` intrinsics should not be emitted in DXIL versions < 1.6
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Icohedron
      </td>
    </tr>
</table>

<pre>
    `llvm.lifetime.start/.end` intrinsics are only supported in DXIL version 1.6 and later. 
Currently Clang allows these intrinsics to be emitted in unsupported shader models.

For DXIL version < 1.6, lifetime intrinsics should be replaced with stores of 0 or undef as in DXC:
https://github.com/microsoft/DirectXShaderCompiler/blob/d751c827ed3b61e87fdf57d0f424cb2d7af30cd0/lib/HLSL/DxilPreparePasses.cpp#L693-L699
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUksFunDAQhp_GXEZBxhgcDhzSXaFG2kOkXHI19rC4MjbymKR5-wq6UdIeKvUEEpr_45_5NJG7BsSeNd9Ycy70lueY-kcTZ7QphmKM9r1nLff-dSm9mzC7BUvKOmUmhhKDZS0HF3JygZwh0AkhBv8OtK1rTBktuADnl8cLvGIiFwNUZQs6WPA6YyqB8YfTlhKG7N_h5HW4gvY-vhHkGQm_hucIIwIuLt9yt_CJoVlbTLBEi55Kxh8Yfxhi-pPN6tPOZ-IEH22-AmiOm7c7JOHqtUELby7PQDkmJIgTcIgJtmBxAk2_q51YvbPmnFfaX8XAxHB1ed7G0sSFiWFxJkWK076zs0to8svz8benuKzOY2JiGH0cmRisaipzLxTaemwrvFeTnRpl-SSFNKOwSk81N5YzMXi3D3y_PF_22J_OPyVcdcInTYRUmnVlor60XX13abuusH1tu7rTBfaVaqpOVLXkxdxLZVu0spWjGadWqlpadd-11aRblG1dF64XXDRccSW47DgvxdRZY_YsZVQzaiY5Ltr58rAkpmvhiDbsK6nqThZej-jpUEyIgG9wfGVC7Malfh-6G7crMcm9o0yfMdllf7h5WxprzvA_Mt7OGWL-y5uvTtCHFMWWfP-PK-7Y2-NuTfEHmh17lCEmhlvb1178CgAA__-J5hg_">