[PATCH] D86978: [IROutliner] Deduplicating functions that only require inputs.

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 17:02:55 PDT 2020


AndrewLitteken added a comment.

A lot of the dead variables belong to future patches, I'll make sure to weed them out in the next diff.



================
Comment at: llvm/lib/Transforms/IPO/IROutliner.cpp:281
+  Group.OutlinedFunction->addFnAttr(Attribute::OptimizeForSize);
+  Group.OutlinedFunction->addFnAttr(Attribute::MinSize);
+
----------------
jroelofs wrote:
> non-rhetorical question: should it be marked noduplicate too?
I'm not entirely sure, it seems like it might be a good idea for safety.


================
Comment at: llvm/lib/Transforms/IPO/IROutliner.cpp:568
+  // Do the same for the other extracted functions
+  for (unsigned Idx = 1; Idx < CurrentGroup.Regions.size(); Idx++) {
+    CurrentOS = CurrentGroup.Regions[Idx];
----------------
jroelofs wrote:
> Why is the first one skipped, and can this be a range-for?
The first extracted function is used to construct the overall outlined function, so it is handled slightly differently.


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

https://reviews.llvm.org/D86978



More information about the llvm-commits mailing list