This is an archive of the discontinued LLVM Phabricator instance.

Store intrinsic ID by value in Function instead of a string lookup. NFC
ClosedPublic

Authored by pete on May 18 2015, 2:53 PM.

Details

Reviewers
pete
dexonsmith
Summary

On 64-bit targets, Function has 4-bytes of padding in its struct layout.

This uses the space for the intrinsic ID. It is set and recalculated whenever the function name is set. This is similar to the current behavior which clears the function from the intrinsic ID cache when its renamed.

The intrinsic cache itself is removed as the only purpose was to speedup calls to getIntrinsicID() which now just reading the new field in the struct.

Diff Detail

Event Timeline

pete updated this revision to Diff 26018.May 18 2015, 2:53 PM
pete retitled this revision from to Store intrinsic ID by value in Function instead of a string lookup. NFC.
pete updated this object.
pete edited the test plan for this revision. (Show Details)
pete added a reviewer: dexonsmith.
pete added a subscriber: Unknown Object (MLST).
rnk added a subscriber: rnk.May 18 2015, 5:04 PM

You are a hero for doing this. :) I was looking at this the other day and thinking "really, a DenseMap to look up a 32-bit integer?"

pete accepted this revision.May 18 2015, 5:34 PM
pete added a reviewer: pete.

Duncan gave a LGTM by email. Committed as r237641 and r237642.

This revision is now accepted and ready to land.May 18 2015, 5:34 PM
pete closed this revision.Dec 16 2015, 3:46 PM

Forgot to actually close this long since committed code.