[PATCH] D68022: [InstCombine] Don't assume CmpInst has been visited in getFlippedStrictnessPredicateAndConstant

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 08:40:41 PDT 2019


bjope added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5144-5146
     // TODO? If the edge cases for vectors were guaranteed to be handled as they
     // are for scalar, we could remove the min/max checks. However, to do that,
     // we would have to use insertelement/shufflevector to replace edge values.
----------------
lebedev.ri wrote:
> Comment needs updating - the scalar case is no longer guaranteed to be handled,
> so we can't talk about in the vector case.
Maybe I've misunderstood something.

I've assumed that the ConstantIsOk check verified that the edge case had been handled (for the scalar case). And if not we bail out.
So in order to reach the code below this if-elseif-else, for scalars, the edge case should have been handled. Isn't that still true?

I can of course remove this TODO if you think that it isn't valid any longer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68022





More information about the llvm-commits mailing list