[PATCH] D78418: [Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 18 12:55:27 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe00cfe254d99: [Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI (authored by craig.topper).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78418/new/

https://reviews.llvm.org/D78418

Files:
  llvm/lib/Transforms/Utils/Local.cpp


Index: llvm/lib/Transforms/Utils/Local.cpp
===================================================================
--- llvm/lib/Transforms/Utils/Local.cpp
+++ llvm/lib/Transforms/Utils/Local.cpp
@@ -1215,13 +1215,11 @@
 
   // Avoid trouble with ridiculously large TrailZ values, such as
   // those computed from a null pointer.
-  TrailZ = std::min(TrailZ, unsigned(sizeof(unsigned) * CHAR_BIT - 1));
+  // LLVM doesn't support alignments larger than (1 << MaxAlignmentExponent).
+  TrailZ = std::min(TrailZ, Value::MaxAlignmentExponent);
 
   unsigned Align = 1u << std::min(Known.getBitWidth() - 1, TrailZ);
 
-  // LLVM doesn't support alignments larger than this currently.
-  Align = std::min(Align, +Value::MaximumAlignment);
-
   if (PrefAlign > Align)
     Align = enforceKnownAlignment(V, Align, PrefAlign, DL);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78418.258548.patch
Type: text/x-patch
Size: 821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200418/4f8ba97d/attachment.bin>


More information about the llvm-commits mailing list