This is an archive of the discontinued LLVM Phabricator instance.

[LTOCodeGenerator] Iterate over all subtargets when collecting runtime library names that should be protected
ClosedPublic

Authored by ahatanak on Jan 29 2015, 3:41 PM.

Details

Summary

Function accumulateAndSortLibcalls in LTOCodeGenerator.cpp collects names of runtime library functions to protect user-supplied runtime library functions (which was committed in r194514). Currently, this function only scans the TargetLowering object belonging to the "main" subtarget for the library function names. This has to be changed to scan all subtargets now that we have per-function subtarget objects.

Diff Detail

Repository
rL LLVM

Event Timeline

ahatanak updated this revision to Diff 19001.Jan 29 2015, 3:41 PM
ahatanak retitled this revision from to [LTOCodeGenerator] Iterate over all subtargets when collecting runtime library names that should be protected .
ahatanak updated this object.
ahatanak edited the test plan for this revision. (Show Details)
ahatanak added reviewers: echristo, dexonsmith.
ahatanak added a subscriber: Unknown Object (MLST).

The change in llvm-lto.cpp is needed for the test case and it should be committed first as a separate patch.

echristo accepted this revision.Jan 29 2015, 3:47 PM
echristo edited edge metadata.

Seems reasonable. Please add a block comment to the accumulateAndSortLibcalls explaining what it's there for and a brief comment over CodeGen.setCpu explaining that we're setting the cpu (and the underneath attrs) for the default target/subtarget for the module.

Thanks!

-eric

This revision is now accepted and ready to land.Jan 29 2015, 3:47 PM
ahatanak updated this revision to Diff 19007.Jan 29 2015, 4:42 PM
ahatanak edited edge metadata.

Add comment that explains what accumulateAndSortLibcalls does.

This revision was automatically updated to reflect the committed changes.