[llvm] Reland [SimplifyCFG] Delete the unnecessary range check for small mask operation (PR #70542)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 02:50:55 PDT 2023
zmodem wrote:
> > Thanks! The fix looks right to me. It would be good to have a test which covers the case where HasDefaultResults is false though.
>
> hi @zmodem, the new added `switch_lookup_with_small_i1_unreachable` already matched the case where `HasDefaultResults is false`, so I can rename it to **switch_lookup_with_small_i1_default_no_results** if its name is easy to confuse ? (HasDefaultResults is false before the fix, so an error is reported when DefaultResults is used to fill in table hole.)
I think I've also confused myself about `HasDefaultResults` and `DefaultIsReachable`.
`!DefaultIsReachable` implies `!HasDefaultResults`
so yes, the current test covers where we asserted before, but there are other situations where `DefaultIsReachable` can be false, such as when the default case does not result in a constant. I think it would be good if the test covered that too.
https://github.com/llvm/llvm-project/pull/70542
More information about the llvm-commits
mailing list