This is an archive of the discontinued LLVM Phabricator instance.

Expose isLegalToPromot as a global helper function so that SamplePGO pass can call it for legality check.
ClosedPublic

Authored by danielcdh on Jan 30 2017, 2:15 PM.

Event Timeline

danielcdh created this revision.Jan 30 2017, 2:15 PM
davidxl added inline comments.Jan 30 2017, 2:29 PM
lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
149

Why keeping this one value but eliminating all the others?

154

missing space

danielcdh marked an inline comment as done.Jan 30 2017, 2:33 PM
danielcdh added inline comments.
lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
149

forgot to delete the dead code...

davidxl added inline comments.Jan 30 2017, 2:37 PM
lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
248

why hoisting this into the caller?

danielcdh added inline comments.Jan 30 2017, 2:42 PM
lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
248

Because sample PGO does not take "Target" to identify TargetFunction. Instead, it directly uses Module->getFunction(Function_name) to get the "Function *".

davidxl accepted this revision.Jan 30 2017, 2:47 PM

lgtm

This revision is now accepted and ready to land.Jan 30 2017, 2:47 PM
danielcdh closed this revision.Jan 30 2017, 2:57 PM