[llvm-commits] [llvm] r48909 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Duncan Sands baldrick at free.fr
Fri Mar 28 00:08:37 PDT 2008


Hi Chris,

> +/// MemsetRange - Represents a range of memset'd bytes with the ByteVal value.
> +/// This allows us to analyze stores like:
> +///   store 0 -> P+1
> +///   store 0 -> P+0
> +///   store 0 -> P+3
> +///   store 0 -> P+2
> +/// which sometimes happens with stores to arrays of structs etc.  When we see
> +/// the first store, we make a range [1, 2).  The second store extends the range
> +/// to [0, 2).  The third makes a new range [2, 3).  The fourth store joins the
> +/// two ranges into [0, 3) which is memset'able.

so this can't handle
  store 0 -> P+3
  store 0 -> P+2
  store 0 -> P+1
  store 0 -> P+0
?
And what about
  store 0 -> P+0
  store 0 -> P+3 <- not offset by +-one from previous one
  store 0 -> P+1
  store 0 -> P+2
?

Ciao,

Duncan.



More information about the llvm-commits mailing list