[PATCH] D71445: [ConstantFold][SVE] Fix constant folding for scalable vector binary operations.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 12:58:53 PST 2020


huihuiz updated this revision to Diff 240975.
huihuiz marked an inline comment as done.
huihuiz edited the summary of this revision.
huihuiz added a comment.

Apologies for the delay, was on vacation, also got caught up with a work project in the past two weeks.

There is more we can do for scalable vector for ConstantFoldBinaryInstruction. 
E.g., Constant fold binary op with constant splats, refer to https://reviews.llvm.org/D71712

  <binop> (<vty> splat(<ty> <C1>)),
                  (<vty> splat(<ty> <C2>))
  ==>  <vty> splat (<ty> <binop> (C1, C2))

Enable this will require changing API of ConstantVector::getSplat() to take in ElementCount for number of elements.
Probably better to do in a separate patch.

For this patch, we might want to focus on not iterating over scalable vectors.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71445

Files:
  llvm/lib/IR/ConstantFold.cpp
  llvm/test/Analysis/ConstantFolding/vscale.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71445.240975.patch
Type: text/x-patch
Size: 5956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200128/a6384962/attachment.bin>


More information about the llvm-commits mailing list