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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 01:35:56 PST 2020


nikic added a comment.

@aymanmus I have something along these lines in mind...

  %conv = sext i8 %a to i32
  %conv2 = sext i8 %b to i32
  %conv3 = sext i8 %c to i32
  %cmp = icmp slt i32 %conv3, TOO_BIG_CONST
  %cond = select i1 %cmp, i32 %conv2, i32 %conv
  %conv4 = trunc i32 %cond to i16
  ret i16 %conv4

That is, where the `icmp` has a form that passes the `isConstOrExt(C->getOperand(0)) && isConstOrExt(C->getOperand(1))` check, but later gets rejected due to constant bitwidth.

Not sure if that example does it, but I think there must be some case like this, unless I'm misunderstanding the patch.


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

https://reviews.llvm.org/D74484





More information about the llvm-commits mailing list