This is an archive of the discontinued LLVM Phabricator instance.

Allow norecurse attribute on functions that have debug infos.
ClosedPublic

Authored by chrib on Dec 3 2018, 1:08 AM.

Details

Summary

debug intrinsics might be marked norecurse to enable the caller function to be norecurse and optimized if needed. This avoids code gen optimisation differences when -g is used, as in globalOpt.cpp:processInternalGlobal checks.

Diff Detail

Event Timeline

chrib created this revision.Dec 3 2018, 1:08 AM
chrib retitled this revision from debug intrinsics might be marked norecurse to enable the caller function to be maked and optimized if needed. This avoid code gen optimisation differences when -g is used, as in globalOpt.cpp:processInternalGlobal checks. to Set norecurse attribute on functions that have debug infos..Dec 3 2018, 1:11 AM
chrib edited the summary of this revision. (Show Details)

Looks mostly good.

lib/Transforms/IPO/FunctionAttrs.cpp
1311
test/Transforms/InferFunctionAttrs/norecurse_debug.ll
53

Do you need the TBAA info for the testcase?

chandlerc requested changes to this revision.Dec 4 2018, 1:43 AM
chandlerc added inline comments.
lib/Transforms/IPO/FunctionAttrs.cpp
1311

Yeah, I'd much prefer to iterate the filtered sequence here.

This revision now requires changes to proceed.Dec 4 2018, 1:43 AM
chrib marked 2 inline comments as done.Dec 4 2018, 5:46 AM
chrib added inline comments.
lib/Transforms/IPO/FunctionAttrs.cpp
1311

not at function level but yes I can iterate on the BBs something like:

for (auto &BB : *F) {
  for (auto &I : BB.instructionsWithoutDebug())
test/Transforms/InferFunctionAttrs/norecurse_debug.ll
53

indeed no, not related to this issue to the tbaa meta can be removed.

chrib updated this revision to Diff 176642.Dec 4 2018, 8:12 AM
chrib retitled this revision from Set norecurse attribute on functions that have debug infos. to Allow norecurse attribute on functions that have debug infos..
chrib edited the summary of this revision. (Show Details)

iterate with instructionsWithoutDebug
reduce testcase

aprantl accepted this revision.Dec 4 2018, 9:18 AM
This revision was not accepted when it landed; it landed in state Needs Review.Dec 5 2018, 8:50 AM
This revision was automatically updated to reflect the committed changes.