[PATCH] D122485: [SimplifyCFG] Fold mutil cases to And mask

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 07:02:34 PDT 2022


bcl5980 added a comment.

In D122485#3448283 <https://reviews.llvm.org/D122485#3448283>, @spatel wrote:

> In D122485#3448273 <https://reviews.llvm.org/D122485#3448273>, @bcl5980 wrote:
>
>> In D122485#3448240 <https://reviews.llvm.org/D122485#3448240>, @spatel wrote:
>>
>>> Let's add the baseline tests as an NFC commit now, so it is easier to see the diffs.
>>>
>>> The order of the transforms creates an interesting trade-off, so we need a test like this (and probably even more tests):
>>>
>>>   define i8 @same_value_two_case(i32 %i) {
>>>   entry:
>>>     switch i32 %i, label %default [
>>>     i32 -3, label %end
>>>     i32 5, label %end
>>>     ]
>>>   
>>>   default:
>>>     br label %end
>>>   
>>>   end:
>>>     %t0 = phi i8 [ 42, %default ], [ 3, %entry ], [ 3, %entry ]
>>>     ret i8 %t0
>>>   }
>>
>> I'm sorry but what's the difference between this test with switch_to_and0 ? For the negative offset?
>
> Ah, you're correct - I did not see that test diff. But we might want to include a test with negative offset, so we have coverage for that too.

@spatel  I feel so sorry that I check in the baseline test here rGe2d77a160c <https://reviews.llvm.org/rGe2d77a160c5b8141eca3db1fca6dafd97e78288d> with a wrong issue number(show be #39957 but I write #54649).
Can I amend the commit message now?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122485/new/

https://reviews.llvm.org/D122485



More information about the llvm-commits mailing list