[PATCH] D23354: [compiler-rt] Suport dynamic shadow address instrumentation

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 10:50:45 PDT 2016


etienneb added inline comments.

================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1771
@@ +1770,3 @@
+  IRBuilder<> IRB(&F.front().front());
+  LocalDynamicShadow = IRB.CreateAlloca(IntptrTy);
+  assert(LocalDynamicShadow->isStaticAlloca());
----------------
rnk wrote:
> I'm not proposing loading from the global on every shadow memory access, I'm saying you should load once from the global in the entry block and use that load everywhere, rather than spilling it to the stack immediately and reloading before every shadow check. With O1 and higher, mid-level optimizers will immediately do this transform for you, but it's simpler to emit the efficient code in the first place. I'm not sure what will happen at -O0 since the fast register allocator is pretty bad.
As discussed offline, as soon as the entry block dominates all other basic block.... using the result from "load" in the entry block should be enough.

I'm gonna make a patch to try it.
thx rnk for the explanation.


https://reviews.llvm.org/D23354





More information about the llvm-commits mailing list