This is an archive of the discontinued LLVM Phabricator instance.

[ConstantFold][SVE] Fix constand fold for vector call.
ClosedPublic

Authored by huihuiz on Feb 11 2020, 8:53 AM.

Diff Detail

Event Timeline

huihuiz created this revision.Feb 11 2020, 8:53 AM

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

test.ll

declare <vscale x 16 x i8> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)

define <vscale x 16 x i8> @sqadd_i8_low() {
  %r =  call <vscale x 16 x i8> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i8> undef)
  ret <vscale x 16 x i8> %r
}

run: opt -S test.ll -constprop -o -

This revision is now accepted and ready to land.Feb 11 2020, 9:11 AM
This revision was automatically updated to reflect the committed changes.