[PATCH] Skip promotable allocas to improve performance at -O0
vonosmas at gmail.com
Thu Feb 19 18:41:52 PST 2015
Overall, this looks good.
> A bunch of ASan llvm tests are written using promotable allocas. I've added volatile stores or marked the existing stores as volatile to make the allocas non-promotable.
I'm OK with that
> Two of the runtime tests also seem to depend on being run with -O0. With this modification, I am getting the same behavior as when the tests are run with higher optimization levels. I've turned off the mode on those tests since I am not sure if a better fix is available. They fail on comparing values returned by __asan_region_is_poisoned.
Now, this part is interesting. Looks like these tests are failing right now, if we increase optimization level from -O0. I'd say, we should better make these tests more robust instead - if we will force the necessary stack layout there on higher optimization levels, they would work fine after landing this patch as well.
> Should "isInterestingAlloca()" be hoisted out of "FunctionStackPoisoner" and used in "isInterestingMemoryAccess"?
Yes, I think it's fine to skip instrumenting memory accesses to "uninteresting" allocas that don't have redzones around them.
More information about the llvm-commits