This is an archive of the discontinued LLVM Phabricator instance.

[Constants] Add scalable vector support to ConstantVector::getSplat. [IR support for SVE scalable vectors 2/4]
AbandonedPublic

Authored by paulwalker-arm on Nov 24 2016, 7:05 AM.

Details

Summary
Create a version of ConstantVector::getSplat that takes VT::ElementCount
and thus preserves a vector's scalable property.  The result for
non-scalable vectors remain unchanged but scalable vectors use the same
IR sequence as used for non-constant splats.  This prompted updates to
some instructions to ensure they also preserve a vector's scalable
property.

Event Timeline

paulwalker-arm retitled this revision from to [Constants] Add scalable vector support to ConstantVector::getSplat. [IR support for SVE scalable vectors 2/4].
paulwalker-arm updated this object.
paulwalker-arm added a reviewer: majnemer.
paulwalker-arm added a subscriber: llvm-commits.
fhahn added a subscriber: fhahn.Nov 24 2016, 7:20 AM
rengolin edited edge metadata.Nov 29 2016, 10:01 AM

Hi Paul,

I'm really not sure what this will give us in benefit. We can't represent a constant vector of unknown lanes without refactoring the IR textual notation (ex. "<n x 4 x i32> <i32 29, ...>"), so why bother replacing a sequence of instructions in SSA form for one all in the same line?

If we don't need this to proceed, and we'd like to change the representation (at least the textual one), I'd rather leave IR changing decisions for later.

cheers,
--renato

include/llvm/IR/Constants.h
489

Shouldn't you replace the current one, rather than add? Or even, make the old one a wrapper to the EC version with isScalable = false?

lib/IR/Constants.cpp
1048

This is confusing. Better to merge the two and make the other call this one with { NumElts, false }.

test/Transforms/ConstProp/splat.ll
40

I'm not sure what we gain by this being all in the same line versus separate lines.

paulwalker-arm abandoned this revision.May 11 2017, 4:22 AM