The arg is defaulted to false as most of the users of the interface checks for branch probability data.
Synthetic profile propagation is not on by default, so this patch has no effect on default compilations.
Paths
| Differential D61025
Add an optional arg to include/exclude synthetic profile when query hasProfileData ClosedPublic Authored by davidxl on Apr 23 2019, 9:09 AM.
Details Summary The arg is defaulted to false as most of the users of the interface checks for branch probability data. Synthetic profile propagation is not on by default, so this patch has no effect on default compilations.
Diff Detail Event TimelineThis revision is now accepted and ready to land.Apr 23 2019, 11:35 AM Comment Actions Instead of passing a boolean, would it be better to pass ProfileCountType enum? Right now it doesn't make a difference as there are only two valid profile count types, but if that set expands, we could make them like bitmasks and then get a subset match. Comment Actions It is tempting to use enum in this case, however I don't see possible extension to the type (in forseable future), so perhaps keep this way. Closed by commit rL359131: Add optional arg to profile count getters to filter (authored by davidxl). · Explain WhyApr 24 2019, 12:49 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 196348 include/llvm/Analysis/BlockFrequencyInfo.h
include/llvm/Analysis/BlockFrequencyInfoImpl.h
include/llvm/IR/Function.h
lib/Analysis/BlockFrequencyInfo.cpp
lib/Analysis/BlockFrequencyInfoImpl.cpp
lib/IR/Function.cpp
|
To me
return EC.hasValue() && (IncludeSynthetic || !EC.isSynthetic()) looks cleaner and readable, but I'll leave it to you.