[llvm] [Reland][ValueTracking] Improve Bitcast handling to match SDAG (PR #145223)

Abhishek Kaushik via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 13 05:07:49 PDT 2025


abhishek-kaushik22 wrote:

I am not able to find a test that miscompiles with `instcombine`/`instsimplify` pass :(
I think the problem is that in `computeKnownBitsFromContext` there's this check
```
  if (!Q.AC)
    return;
```
which returns early for `always-inline` but not for `instcombine`/`instsimplify` as they pass a `AssumptionCache` object.
Then at the end, we have 
```
  // Conflicting assumption: Undefined behavior will occur on this execution
  // path.
  if (Known.hasConflict())
    Known.resetAll();
```
which resets the known bits and no problematic transform happens.

https://github.com/llvm/llvm-project/pull/145223


More information about the llvm-commits mailing list