[PATCH] D73753: [ConstantFold][SVE] Fix constant folding for scalable vector compare instruction.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 16:50:46 PST 2020


huihuiz created this revision.
huihuiz added reviewers: sdesmalen, efriedma, apazos, huntergr, willlovett.
huihuiz added a project: LLVM.
Herald added subscribers: psnobl, rkruppe, hiraditya, tschuett.
huihuiz added a comment.

current upstream crash at : llvm/lib/IR/Value.cpp:404: void llvm::Value::doRAUW(llvm::Value *, llvm::Value::ReplaceMetadataUses): Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed.

take test.ll

  define <vscale x 4 x i1> @icmp_undef() {
    %r = icmp eq <vscale x 4 x i32> undef, undef
    ret <vscale x 4 x i1> %r
  }

run : ./bin/opt -S -constprop t.ll -o -


Do not iterate on scalable vector. Also do not return constant scalable vector
from ConstantInt::get().
Fix result type by using getElementCount() instead of getNumElements().


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73753

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73753.241609.patch
Type: text/x-patch
Size: 5275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200131/f118c965/attachment.bin>


More information about the llvm-commits mailing list