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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 20 09:53:52 PDT 2021


lebedev.ri 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());
----------------
FWIW i think we can generalize this like that in the future.


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