DeadArgumentElim] Clone function level metadatas
ClosedPublic

Authored by xur on Mar 5 2018, 4:37 PM.

Details

Summary

Some Function level metadatas, such as function entry count, are not cloned in DeadArgumentElim. This happens a lot in lto/thinlto because of DeadArgumentElim after internalization.

This patch clones the metadatas in the original function to the new function.

Diff Detail

Repository
rL LLVM
xur created this revision.Mar 5 2018, 4:37 PM

Also add an dead vararg elimination test case for better coverage.

test/Transforms/DeadArgElim/func_metadata.ll
13 ↗(On Diff #137106)

dead arg elim is missing the test case.

27 ↗(On Diff #137106)

Simplify the attribute.

xur updated this revision to Diff 137222.Mar 6 2018, 10:08 AM

Integrated David's review comments: (1) add vararg test (2) simplify function attributes.

This revision is now accepted and ready to land.Mar 13 2018, 12:10 PM
This revision was automatically updated to reflect the committed changes.