[PATCH] D37848: [ELF] - Dedupliсate FDEs correctly when two sections are ICFed
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 18 12:11:46 PDT 2017
ruiu added a comment.
I don't think this is in the right direction. This seems too slow and too complicated. Why don't you just skip FDEs whose section IS does not satisfy `IS == IS->Repl`? Usually `IS == IS->Repl`, but if IS has been merged by ICF, `IS != IS->Repl`, so you can easily identify if a given section has been merged by ICF.
That said, first of all, do you think you are doing is right? It seems that the current ICF code merges two different functions that are otherwise identical except FDEs. We should take FDEs into account when comparing functions in ICF, shouldn't we? (I'm not saying that you should update this patch, but I want you to think.)
================
Comment at: ELF/SyntheticSections.cpp:436
+ return nullptr;
+ auto *Target =
+ cast<InputSectionBase>(cast<InputSectionBase>(D->Section)->Repl);
----------------
This temporary variable is redundant.
https://reviews.llvm.org/D37848
More information about the llvm-commits
mailing list