-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Arc] Add statistics to the FindInitialVectors pass #7113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really useful statistics, thanks! 🎉
Added a few comments, but looks great otherwise!
@@ -62,6 +62,16 @@ def FindInitialVectors : Pass<"arc-find-initial-vectors", "mlir::ModuleOp"> { | |||
let summary = "Find initial groups of vectorizable ops"; | |||
let constructor = "circt::arc::createFindInitialVectorsPass()"; | |||
let dependentDialects = ["arc::ArcDialect"]; | |||
let statistics = [ | |||
Statistic<"numOfVectorizedOps", "vectorOps", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the name vectorOps
suggests the same as numOfVectorsCreated
, i'd rename it slightly:
Statistic<"numOfVectorizedOps", "vectorOps", | |
Statistic<"numOfVectorizedOps", "vectorizedOps", |
Statistic<"numOfSavedOps", "numOfSavedOps", | ||
"Total number of ops saved after FindInitialVectors pass">, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this always equivalent to vectorOps - numOfVectorsCreated
and could, therefore, be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a = b + c
d = e + f
g = h + i
after vectorization: [a, d, g] = [b, e, h] + [c, f, i]
biggestSeedVector: 3
numOfSavedOps: 2 (we had 3 ops but now we have one)
numOfVectorsCreated: 1
numOfVectorizedOps: 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, 3-1=2. I don't mind having it, just wanted to point out the redundancy.
size_t vecOps = 0; | ||
size_t savedOps = 0; | ||
size_t bigSeedVec = 0; | ||
size_t vecCreated = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use global variables; it's not thread-safe since multiple instances of FindInitialVectorsPass
would access the same variables. You can make them members of the pass class instead (potentially creating a struct that groups them and thus makes it easier to pass them as function arguments).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Do you want me to merge it?
Statistic<"numOfSavedOps", "numOfSavedOps", | ||
"Total number of ops saved after FindInitialVectors pass">, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, 3-1=2. I don't mind having it, just wanted to point out the redundancy.
I just wanted to make the number clear, what do you think?
If you think we don't need to remove |
No description provided.