[PATCH] D68128: [InstCombine] Fold PHIs with equal incoming pointers

Daniil Suchkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 10 22:25:35 PST 2019


DaniilSuchkov marked an inline comment as done.
DaniilSuchkov added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp:1171
+
+  Builder.SetInsertPoint(InsertPt);
+  Type *I8PtrTy = Builder.getInt8PtrTy(PhiTy->getAddressSpace());
----------------
lebedev.ri wrote:
> Do you want to restore previous insertion point afterwards, i.e. use `InsertPointGuard`?
I don't think so. In general it doesn't look like it is a common practice to restore insertion point in InstCombine (5 uses of InsertPointGuard vs 27 uses of SetInsertPoint). Moreover, in InstCombiner::run IP is being reset at every iteration, so it makes sense to reset IP only within helper functions that are to be called from other transformations, but this function isn't intended to be used this way.


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

https://reviews.llvm.org/D68128





More information about the llvm-commits mailing list