This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Propagate Cold attribute inter procedurally
AcceptedPublic

Authored by kuter on Aug 3 2021, 4:24 PM.

Details

Summary

This patch adds AAHotCold, which propagates the cold attribute.
The Attribute marks a function as cold if all of it's callers are cold.

Other ways of propagating the hot/cold attributes are planned.

Diff Detail

Event Timeline

kuter created this revision.Aug 3 2021, 4:24 PM
kuter requested review of this revision.Aug 3 2021, 4:24 PM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
kuter updated this revision to Diff 364317.Aug 4 2021, 7:05 PM

small fix.

jdoerfert added inline comments.Aug 11 2021, 8:09 AM
llvm/include/llvm/Transforms/IPO/Attributor.h
4636

We need more than a boolean state, no? Maybe we should use a 3-bit (or 4-bit) state here instead of an optional in the Impl.

llvm/lib/Transforms/IPO/AttributorAttributes.cpp
9605

let's implement this one

kuter updated this revision to Diff 367367.Aug 18 2021, 5:26 PM

Fix the depgraph.ll

kuter added inline comments.Aug 19 2021, 1:47 PM
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
9605

I implemented this in D107705

kuter updated this revision to Diff 367708.Aug 19 2021, 9:51 PM

Use a BitState instead of hacky Option<bool>
I will rebase the rest of the patch set.

jdoerfert accepted this revision.Aug 22 2021, 8:28 PM

Lg, one nit.

llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
162

see below.

llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
300

run the script on this file until the change disappears, non-determinism.

This revision is now accepted and ready to land.Aug 22 2021, 8:28 PM