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

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 10:42:16 PDT 2016


rnk 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());
----------------
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.


https://reviews.llvm.org/D23354





More information about the llvm-commits mailing list