[PATCH] D108355: [AggressiveInstCombine] Add arithmetic shift right instr to `TruncInstCombine` DAG

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 21 00:16:34 PDT 2021


anton-afanasyev added inline comments.


================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp:407-410
       // Preserve `exact` flag since truncation doesn't change exactness
-      if (Opc == Instruction::LShr)
+      if (Opc == Instruction::LShr || Opc == Instruction::AShr)
         if (auto *ResI = dyn_cast<Instruction>(Res))
           ResI->setIsExact(I->isExact());
----------------
lebedev.ri wrote:
> FWIW i think we can generalize this like that in the future.
Thanks, done.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108355



More information about the llvm-commits mailing list