[llvm] 413b499 - [InstCombine] recognizeBSwapOrBitReverseIdiom - use ArrayRef::back() helper. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 05:39:41 PDT 2020


Author: Simon Pilgrim
Date: 2020-09-30T13:39:18+01:00
New Revision: 413b4998bd722ab671e29e6dff5d458d1869f39b

URL: https://github.com/llvm/llvm-project/commit/413b4998bd722ab671e29e6dff5d458d1869f39b
DIFF: https://github.com/llvm/llvm-project/commit/413b4998bd722ab671e29e6dff5d458d1869f39b.diff

LOG: [InstCombine] recognizeBSwapOrBitReverseIdiom - use ArrayRef::back() helper. NFCI.

Post-commit feedback on D88316

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 463c6f15492b..a76dc655ddbf 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -3027,7 +3027,7 @@ bool llvm::recognizeBSwapOrBitReverseIdiom(
          "Illegal bit provenance index");
 
   // If the upper bits are zero, then attempt to perform as a truncated op.
-  if (BitProvenance[BitProvenance.size() - 1] == BitPart::Unset) {
+  if (BitProvenance.back() == BitPart::Unset) {
     while (!BitProvenance.empty() && BitProvenance.back() == BitPart::Unset)
       BitProvenance = BitProvenance.drop_back();
     if (BitProvenance.empty())


        


More information about the llvm-commits mailing list