[InstCombine] recognizeBSwapOrBitReverseIdiom - use ArrayRef::back() helper. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 30 Sep 2020 12:39:18 +0000 (13:39 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 30 Sep 2020 12:39:18 +0000 (13:39 +0100)
Post-commit feedback on D88316

llvm/lib/Transforms/Utils/Local.cpp

index 463c6f1..a76dc65 100644 (file)
@@ -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())