[PATCH] D98351: [llvm-opt] Bug fix within combining FP vectors

Nashe Mncube via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 05:52:40 PDT 2021


nasherm added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:1639
 /// Find the minimum FP type we can safely truncate to.
 static Type *getMinimumFPType(Value *V) {
   if (auto *FPExt = dyn_cast<FPExtInst>(V))
----------------
david-arm wrote:
> Hi @nasherm, is it possible to just add code to this function that does something like this?
> 
>   if (auto *CV = dyn_cast<Constant>(V))
>     if (auto *FPExt = dyn_cast<FPExtInst>(CV->getOperand(0)))
>       return FPExt->getOperand(0)->getType();
> 
> Then in shrinkFPConstantVector you could just bail out early on for scalable vectors? Does that give you the same effect?
That doesn't work as the the second `dyn_cast` will fail. It seems like FPExt within a Constant can't be cast in that way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98351



More information about the llvm-commits mailing list