[PATCH] D52707: Switch optimization in IR for known maximum switch values

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 12:30:51 PDT 2018


efriedma added a comment.

The yellow bars are just Phabricator noting copy-pasted code; if you hover over the bar, you can get more details from the tooltip.  You might not have to do anything about it in general, but in this case I think it's worth refactoring.



================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4859
+         ValueWidth)
+    MaxSwitchValue = (1 << Known.countMaxTrailingOnes()) - 1;
+
----------------
Can this shift overflow?


Repository:
  rL LLVM

https://reviews.llvm.org/D52707





More information about the llvm-commits mailing list