[PATCH] D72837: [AggressiveInstCombine] Add support for select instruction.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 05:16:38 PST 2020


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

LGTM



================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp:59
     break;
+  case Instruction::Select: {
+    Ops.push_back(I->getOperand(1));
----------------
Style nit: Omit `{}` if not necessary.


================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp:203
           continue;
-        InstInfoMap[IOp].ValidBitWidth = std::max(ValidBitWidth, IOpBitwidth);
+        InstInfoMap[IOp].ValidBitWidth = ValidBitWidth;
         Worklist.push_back(IOp);
----------------
lebedev.ri wrote:
> aymanmus wrote:
> > lebedev.ri wrote:
> > > Why is this being changed?
> > > 
> > The max operation is not needed here.
> > If we reach this point of the code, then ValidBitWidth MUST be bigger than IOpBitwidth (because other wise we'll hit the "continue" at line 202.
> Can you submit that as a separate change then please?
This change looks fine, but please commit it independently as NFC.


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

https://reviews.llvm.org/D72837





More information about the llvm-commits mailing list