There's still some cases where whitespace causes the parsing to fail:
" builtin.module()" - error: can't run ' builtin.module' pass manager on 'builtin.module' op "builtin.module ()" - error: can't run 'builtin.module ' pass manager on 'builtin.module' op "builtin.module() " - error: expected pass pipeline to be wrapped with the anchor operation type, e.g. 'builtin.module(...)'
Looks great! Thanks very much @jain98!
add space for warning message.
Can you please split this into an NFC patch that splits off analyzeKnownBitsFromAndXorOr() without changing logic, and then one that implements the new folds? (D142429 could be based on either one.)
Rebase after splitting
Added test file (lost on last update)
Overall seems a reasonable implementation, despite the limitations pointed out in the patch description.
Use X86::AddrBaseReg instead of looping
Add 1 more test to highlight need of isAssumedTrue
Updated tests, fixed some nits, rebase
We should be testing canonical IR here (use -passes=instcombine), at which point many of these should already be handled. E.g. if you have a condition abs(X) != 0, that should get canonicalized to X != 0 first, and then handled by existing code.
Move tests to instcombine + small updates to conditions
Remove invoke/ rebase