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.
Details
Diff Detail
- Build Status
Buildable 1589 Build 1589: arc lint + arc unit
Event Timeline
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. |
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?