[PATCH] D117804: [TargetLowering][InstCombine] Simplify BSwap demanded bits code a little. NFC

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 10:34:09 PST 2022


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:806-811
         if (BitWidth-NLZ-NTZ == 8) {
-          unsigned ResultBit = NTZ;
-          unsigned InputBit = BitWidth-NTZ-8;
-
           // Replace this with either a left or right shift to get the byte into
           // the right place.
           Instruction *NewVal;
-          if (InputBit > ResultBit)
+          if (NLZ > NTZ)
             NewVal = BinaryOperator::CreateLShr(II->getArgOperand(0),
----------------
Spacing/indentation look wrong (clang-format).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117804



More information about the llvm-commits mailing list