[PATCH] D22936: Remove TargetBaseAlign. Keep alignment for stack adjustments.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 14:17:45 PDT 2016


jlebar added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:43
@@ -42,5 +42,3 @@
 
-// TODO: Remove this
-static const unsigned TargetBaseAlign = 4;
-
+static const unsigned StackAdjustedAlignment = 4;
 typedef SmallVector<Instruction *, 8> InstrList;
----------------
I think we still want a comment here, because we're basically assuming that 4 bytes is good enough for any type.

================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:1033
@@ -1034,5 +1032,3 @@
                                                    Alignment, &Fast);
-  // TODO: Remove TargetBaseAlign
-  return !(Allows && Fast) && (Alignment % SzInBytes) != 0 &&
-         (Alignment % TargetBaseAlign) != 0;
+  return !(Allows && Fast) && (Alignment % SzInBytes) != 0;
 }
----------------
Can we rewrite this function as

  if (Alignment % SzInBytes == 0)
    return true;
  bool Fast = false;
  bool Allows = ...;
  return !Allows || !Fast;

That would make it a lot more obvious to me.


https://reviews.llvm.org/D22936





More information about the llvm-commits mailing list