[PATCH] D74484: [AggressiveInstCombine] Add support for ICmp instr that feeds a select intsr's condition operand.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 07:46:02 PST 2020


lebedev.ri marked an inline comment as done.
lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp:226
               std::max(Info.MinBitWidth, InstInfoMap[IOp].MinBitWidth);
+        else if (auto *C = dyn_cast<ConstantInt>(Operand)) {
+          // In case of Cmp instruction, make sure the constant can be truncated
----------------
lebedev.ri wrote:
> Hm, can't we already get a constant operand in one of the supported instructions?
> If yes, then i would semi-strongly suggest to split this up again..
Ah, i see what i'm missing: AIC does not perform DCE,
so i was looking at https://godbolt.org/z/ZXpBui
and it wasn't being transformed because dead `%cmp` was still present.
If it's not there (https://godbolt.org/z/UEMDQN), then we deal with ordinary constants fine.
So i see this is ICmp-specific, and should be kept here.


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

https://reviews.llvm.org/D74484





More information about the llvm-commits mailing list