[llvm] 9be6728 - [InstCombine] Drop outdated alignment comment (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 21 00:07:06 PST 2021


Author: Nikita Popov
Date: 2021-12-21T08:58:48+01:00
New Revision: 9be67289b306cb1a7ee1452c2ae497c899ff54c5

URL: https://github.com/llvm/llvm-project/commit/9be67289b306cb1a7ee1452c2ae497c899ff54c5
DIFF: https://github.com/llvm/llvm-project/commit/9be67289b306cb1a7ee1452c2ae497c899ff54c5.diff

LOG: [InstCombine] Drop outdated alignment comment (NFC)

Loads always have an alignment now, so this is no longer relevant.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
index 35739c3b9a215..30f6aab2114bf 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
@@ -664,10 +664,7 @@ Instruction *InstCombinerImpl::foldPHIArgLoadIntoPHI(PHINode &PN) {
     return nullptr;
 
   // When processing loads, we need to propagate two bits of information to the
-  // sunk load: whether it is volatile, and what its alignment is.  We currently
-  // don't sink loads when some have their alignment specified and some don't.
-  // visitLoadInst will propagate an alignment onto the load when TD is around,
-  // and if TD isn't around, we can't handle the mixed case.
+  // sunk load: whether it is volatile, and what its alignment is.
   bool isVolatile = FirstLI->isVolatile();
   Align LoadAlignment = FirstLI->getAlign();
   unsigned LoadAddrSpace = FirstLI->getPointerAddressSpace();
@@ -699,7 +696,7 @@ Instruction *InstCombinerImpl::foldPHIArgLoadIntoPHI(PHINode &PN) {
         !isSafeAndProfitableToSinkLoad(LI))
       return nullptr;
 
-    LoadAlignment = std::min(LoadAlignment, Align(LI->getAlign()));
+    LoadAlignment = std::min(LoadAlignment, LI->getAlign());
 
     // If the PHI is of volatile loads and the load block has multiple
     // successors, sinking it would remove a load of the volatile value from


        


More information about the llvm-commits mailing list