[PATCH] D84948: [InstCombine] Fold freeze(undef) into a proper constant

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 00:55:49 PDT 2020


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM. There are various ways in which the value choice can be improved, but this looks like a good starting point.



================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3415
+
+    return replaceInstUsesWith(I, BestValue);
+  }
----------------
I would `assert(BestValue && "Must have at least one use")` here. Dead freeze should be cleaned by the main InstCombine loop already, so there must be at least one use here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84948



More information about the llvm-commits mailing list