<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/89414>89414</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DAG] SelectionDAG.computeKnownBits - add NSW/NUW flags support to ISD::SHL handling
</td>
</tr>
<tr>
<th>Labels</th>
<td>
good first issue,
llvm:SelectionDAG
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
RKSimon
</td>
</tr>
</table>
<pre>
The call to KnownBits::shl is currently not handling nodes that have the NSW/NUW flags (or a known non zero shift amount).
https://github.com/llvm/llvm-project/blob/e553ac4d8148291914526f4f66f09e362ce0a63f/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp#L3497-L3506
This task will mainly involve adding test coverage - my advice would be to disable the equivalent handling in ValueTracking, run `check-llvm-transforms` to see what tests start failing and see what equivalent tests can be created for CodeGen/X86
https://github.com/llvm/llvm-project/blob/e553ac4d8148291914526f4f66f09e362ce0a63f/llvm/lib/Analysis/ValueTracking.cpp#L1168-L1182
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEk0FzozgQhX-NuHTZBRLI6MDBiYvsVlw5rLObvQrRgNZC8krCLs-vnwJXEmfmNKe5QEG1ulvfe0-GoHuLWJHigRS7RE5xcL766_mgR2eTxrXX6nVAUNIYiA6erbvYBx0DYVvCtmEwoAOoyXu00VzBugiDtK3RtgfrWgwQBzn_OyPEAeHl8EZo_fL3G3RG9gEILZ0HCce5MVhn4Rt6B2HQXQQ5uslGQsWapDuSbm_PIcbTMp_WhNa9jsPUrJUbCa2NOb-_Vifv_kMVCa0b4xpCaywKJlXellleUpGJLC8o7_KO8y4VyDhVmErOurs-ej736Fp8QktofUCDKmpnd9unHz7X6nQilO1ZLjarPStSfr_y66ADRBmOcNHGwCi1NVfQ9uzMGUG27YwrYoig3Bm97BFWMF5BtmetEC5uMi00OCvQ6iAbc4OJ_0_6LA3aO-jawj_STPjqpTpq2xP6CH6yQHiqBlTH1QInemlD5_wYCE_ntgERLrNS8xYBQpQ-Qif10lPa9rPgbuitVkk776Y8yogtdM7DJ7J_S_47tdtaaa5BB0LrL1Te5coyXq72WVbSpK1YK5iQCVbZJmNFnmeCJ0OlRLkpN6JgLOVl3nWiYAVuGhRNyctUqURXNKV5mmci41QUfF0iFoIVZYmKZ51kJE9xlNqs59XWzveJDmHCqhR5lidGNmjCEkBKe-da6LQPEZYaQimhj4TS5VZs-9WBdI6srxZkzdQHkqdGhxg-B0UdzRLuub7YwVfLuvE0RfzINKxmK_4U0TCdTs7H2SV_Hna34B_-2H9YLpm8qX5Z2OV6sy4Lhe8BAAD__1qmdq4">