[PATCH] D18827: Rework/enhance stack coloring data flow analysis.

Than McIntosh via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 10:38:34 PDT 2016


thanm added a comment.

Wei wrote: //But isn't bar() could potentially change ar1 and ar2 indirectly since ar1 and ar2 are escaped local arrays from current func?//

GCC's implementation completely ignores "lifetime start" and instead adds a var X to the work set the first time it sees a reference to it. So on entry to BB1 it has not yet seen any references to "ar2", so when it processes "call bar(&ar1)" no edge is added. Ditto for processing BB2; live-in for the block is empty (since no explicit references in the entry block), so when it sees "call bar(&a2)" no edge is added. Both ar1 and ar1 are part of the work set on entry to BB3, but BB3 has no instructions that could access memory.

BTW in the abstract IR there is a typo, call in BB2 should be "call bar(&ar2)" not "call bar(&ar1)".


http://reviews.llvm.org/D18827





More information about the llvm-commits mailing list