[llvm-commits] patch: partial DSE

Eric Christopher echristo at apple.com
Tue Nov 1 14:47:36 PDT 2011


On Oct 31, 2011, at 5:38 PM, Peter Cooper wrote:

> Hi
> 
> Please review this patch to allow DSE to trim stores as opposed to deleting them.
> 
> The logic here is that if the end of the earlier store is dead because of a later store then the length of the earlier store will be trimmed in size to avoid writing dead memory.  The only time i won't do this is if the original store was likely to use vector writes which if shortened would end up as multiple scalar writes and so is less efficient.
> 

Not a huge fan of this style:

+          (OR = isOverwrite(Loc, DepLoc, *AA, 
+                            DepWriteOffset,
+                            InstWriteOffset)) != OverwriteUnknown &&

in large conditionals. Things that return booleans, or set something for a block, e.g.:

if (ConstantInt *CI = dyn_cast<ConstantInt>(Inst)) {
}

> Any help removing the magic vector size (16) constant would be good too :)

Something like this maybe?

bool isLegalVector = false;
if (VectorType *VecTy = dyn_cast<VectorType>(Store->getType()) {
  EVT VT = TLI.getValueType(VecTy);
  isLegalVector = TLI.isTypeLegal(VT);
}

does require target info though and I'm not sure how kosher that is in AA.

-eric



More information about the llvm-commits mailing list