[PATCH] D85159: [ConstProp] Remove ConstantPropagation

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 12:18:41 PDT 2020


nikic added inline comments.


================
Comment at: llvm/test/Analysis/ConstantFolding/vscale.ll:210
-;
-  %i1 = insertelement <vscale x 4 x i32> undef, i32 1, i32 0
-  %i2 = shufflevector <vscale x 4 x i32> %i1, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
----------------
aeubanks wrote:
> fhahn wrote:
> > why are those removed? Is that functionality missing from instsimplify?
> Looks like in ConstProp it always calls `ConstantFoldInstruction()`, which in this case just returns the same value, and replaces all uses, inlining into the ret. But InstSimplify calls `SimplifyInstruction()` which special cases vector instructions but doesn't know how to simplify these values any more, so it returns nullptr and InstSimplify doesn't do anything.
> 
> Maybe inlining these values into the ret isn't super useful?
Sounds like an InstSimplify bug. SimplifyInstruction is supposed to be a superset of ConstantFoldInstruction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85159



More information about the llvm-commits mailing list