[PATCH] D98058: [InstCombine] Simplify phis with incoming pointer-casts.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 8 06:00:04 PST 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp:1325-1327
+        all_of(PN.incoming_values(), [Inc0, Inc0Stripped](Value *Inc) {
+          return Inc0 == Inc || Inc0Stripped == Inc->stripPointerCasts();
+        })) {
----------------
lebedev.ri wrote:
> I would recommend a less brute-force approach.
> Add a map<IV, stripped>, and don't redo the work if the result is known.
Well, i guess `map` is an overkill, just `set<IV>` should be plenty enough.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98058



More information about the llvm-commits mailing list