[PATCH] DataFlowSanitizer; LLVM changes.

Evgeniy Stepanov eugenis at google.com
Wed Jul 3 07:55:39 PDT 2013


  Looks good.


================
Comment at: lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:723
@@ +722,3 @@
+  uint64_t Offset = 0;
+  if (Size >= ShadowVecSize) {
+    VectorType *ShadowVecTy = VectorType::get(DFS.ShadowTy, ShadowVecSize);
----------------
Peter Collingbourne wrote:
> Evgeniy Stepanov wrote:
> > This looks like an optimization that belongs elsewhere. I wonder if there is a pass in LLVM that will do it for you?
> > Also, why 128 bit code here, and only 64 bit in LoadShadow?
> > This looks like an optimization that belongs elsewhere. I wonder if there is a pass in LLVM that will do it for you?
> 
> I don't think there is one.  I tried optimising the following code with -O3; no improvement:
> 
> void f(short *p, short s) {
>   for (unsigned i = 8; i != 0; --i, ++p) {
>     *p = s;
>   }
> }
> 
> > Also, why 128 bit code here, and only 64 bit in LoadShadow?
> 
> Because LoadShadow needs to be able to do equality comparisons and collapse the result into a single bit.  It also needs to be able to compare every 16-bit element of the 128-bit vector against one another. There are some short instruction sequences for the former (on x86), but LLVM doesn't seem to be able to generate them, and I haven't thought too much about the latter yet.
Btw, this code is vectorized when trip count is raised to 16.



http://llvm-reviews.chandlerc.com/D965

BRANCH
  dfsan-up

ARCANIST PROJECT
  llvm



More information about the llvm-commits mailing list