[PATCH] D146267: [llvm] Handle duplicate call bases when applying branch funneling

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 16:34:55 PDT 2023


leonardchan added a comment.

In D146267#4202607 <https://reviews.llvm.org/D146267#4202607>, @aeubanks wrote:

> any overlap with D104798 <https://reviews.llvm.org/D104798>?

Yeah this this looks pretty similar. Opting to use the set approach you use there.



================
Comment at: llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp:1397
 
+      if (!CB.getParent()) {
+        // When finding devirtualizable calls, it's possible to find the same
----------------
tejohnson wrote:
> I don't think this is safe since when we eraseFromParent the instruction is deleted. Can we track a different way?
Updated to just add erased pointers to a set and check on future iterations if they're in the set. This way we don't have to deref them.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146267



More information about the llvm-commits mailing list