This patch introduces call base context information to the IRPosition
This patch is part of the patch set that are going to introduce call base specific analysis.
Btw this patch introduces 8 bytes per attribute because of the CBContext.
I think we would ideally move it to a map inside the attributor.
I can inject the context through the update method or make the attribute ask the Attributor
like A.getCBContext(this); one problem with it is that since the operator<< for IRPosition don't have access
to the attributor we would not be able to print it even though it is useful to have.
One potential solution to this is to use a macro switch to have the CBContext inside the IRPosition only in debug builds.
Any other ideas ?
Run heapcheck and if the cgscc memory usage is not impacted much keep it this way ;)
We need a test for this. We can use unit tests or check the printed output (lit test + requires: asserts IIRC). Either works but we should add one.
I'd prefer to copy the entire thing and then null the context. Will be optimized to the same code but is future proof :)
Documentation for all of them please.
Nit: I would prefer to move/add the initialization here. Assuming it is all the same to you.
Move this into a helper function so we don't have to "make LLVM_DEBUG" work here.
& RealIRP or maybe:
if (!should...) IRP = IRP.strip...
|90 ↗||(On Diff #277674)|
Nit: attributor-enable-call-site-specific is missing a final word, maybe specialization or deduction or something.
|465 ↗||(On Diff #277674)|
|803 ↗||(On Diff #277674)|
You are right. We can remove the const and reference from IRP actually. Either way is fine with me. If we do it as you have it now, maybe make it a reference. I'm not sold on Real as a name, maybe Effective, but that is not perfect either.
Memory usage for this patch:
comand: $LLVM_BIN/opt -S -attributor-cgscc test-suit/CTMark/SPASS/clause.ll
calls to allocation functions: 78794 (82506/s) temporary memory allocations: 3942 (4127/s) peak heap memory consumption: 2.58MB peak RSS (including heaptrack overhead): 355.73MB total memory leaked: 140.33KB
calls to allocation functions: 78802 (86977/s) temporary memory allocations: 3942 (4350/s) peak heap memory consumption: 2.59MB peak RSS (including heaptrack overhead): 356.60MB total memory leaked: 140.33KB
calls to allocation functions: 8 (-163/s) temporary memory allocations: 0 (0/s) peak heap memory consumption: 8.26KB peak RSS (including heaptrack overhead): 0B total memory leaked: 0B
Interesting, there doesn't seem to be much of a difference.
I made a mistake while creating this revision.
This is incomplete. instead of amending the [Attributor] Introduce CallBaseContext to the IRPosition I created a new commit and when I did arc diff It updated it to the state it is.
I will update this to include all of the patch.
sorry for the mess.
Yes thank you, I should have ran the tests in D83744 before updating the revision.