Does MSVC compiler (Microsoft Visual Studio) does any optimization such as converting to a look-up or hash table for switch-case statements?
Asked
Active
Viewed 153 times
1
-
https://learn.microsoft.com/en-us/cpp/build/reference/fa-fa-listing-file?view=vs-2019 – Hans Passant Dec 19 '19 at 23:14
-
1I would be shocked and awed if it didn't – Mooing Duck Dec 19 '19 at 23:43
-
3As someone who has had to decompile VS generated code I can assure you it does do switch tables and other optimisations such as 2 level switch tables, etc. – Mike Vine Dec 19 '19 at 23:47
-
1https://gcc.godbolt.org/z/EDNynm – Raymond Chen Dec 20 '19 at 00:48
-
yes of course. It can also [generate a bit lookup table](https://stackoverflow.com/q/26124620/995714) – phuclv Dec 06 '22 at 16:44