[PATCH] D147954: [SimplifyCFG]Prevent premature simplification of callsites with profile data

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 16:08:57 PDT 2023


davidxl added inline comments.


================
Comment at: llvm/test/Transforms/SimplifyCFG/preserve-call-metadata-in-hoist.ll:8
+; Without preserving call instructions, `d->func1` is hoisted while it may not make sense
+; to do so. For example, the candidate calls are different based on derived type.
+; class Base {
----------------
Perhaps add "merging meta data will make the profile data less precise and not desirable either".


================
Comment at: llvm/test/Transforms/SimplifyCFG/preserve-call-metadata-in-hoist.ll:17
+;
+; Base* createType(int c);
+;
----------------
->createptr to match the name used in IR.


================
Comment at: llvm/test/Transforms/SimplifyCFG/preserve-call-metadata-in-hoist.ll:20
+; int func(int x, int a, int b, int c) {
+;    Base* d = createType(c);
+;    if (d->gettype() % 5 == 0) {
----------------
createptr


================
Comment at: llvm/test/Transforms/SimplifyCFG/preserve-call-metadata-in-sink.ll:16
+;
+; Base* createType(int c);
+;
----------------
createptr


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

https://reviews.llvm.org/D147954



More information about the llvm-commits mailing list