[PATCH] D24271: [LV] Don't mark pointers used by scalarized memory accesses uniform

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 15:23:02 PDT 2016


mkuper added a comment.

This LGTM, except for the type size bit, which I'm still not sure I completely understand.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:5325
@@ +5324,3 @@
+  auto *ScalarTy = LI ? LI->getType() : SI->getValueOperand()->getType();
+  if (DL.getTypeSizeInBits(ScalarTy) != DL.getTypeAllocSizeInBits(ScalarTy))
+    return true;
----------------
I'm still not 100% convinced.

I mean, I'm fairly sure this is correct, I'm just not sure this doesn't miss any cases we would have caught before, where the sizes in bits don't match, but the rounded sizes do. (And to be honest, I'm not sure what the correct behavior is anymore)

To be more explicit originally we were comparing:
alignTo((getTypeSizeInBits(Ty) + 7) / 8, getABITypeAlignment(Ty))
to
(((VF * getTypeSizeInBits(Ty)) + 7) / 8) / VF

And now we're comparing:
alignTo((getTypeSizeInBits(Ty) + 7) / 8, getABITypeAlignment(Ty)) * 8
to
getTypeSizeInBits(Ty)

Are you absolutely sure these are equivalent (or the second one is "more correct")?


https://reviews.llvm.org/D24271





More information about the llvm-commits mailing list