[PATCH] D93850: [InstCombine] Rewrite (switch (zext X)) as (switch X).

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 27 23:25:35 PST 2020


lebedev.ri added a reviewer: lebedev.ri.
lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2952-2953
+  if (match(Cond, m_ZExtOrSExt(m_Value(CastOp)))) {
+    unsigned CastOpWidth = computeKnownBits(CastOp, 0, &SI).getBitWidth();
+    if (NewWidth > 0 && NewWidth <= CastOpWidth) {
+      for (auto Case : SI.cases()) {
----------------
Why do we need this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93850



More information about the llvm-commits mailing list