Skip to content

[ENCODEGEN] Handle vector splat constants in constant pool - #48

Open
marcauberer wants to merge 1 commit into
tpde2:masterfrom
marcauberer:master
Open

[ENCODEGEN] Handle vector splat constants in constant pool#48
marcauberer wants to merge 1 commit into
tpde2:masterfrom
marcauberer:master

Conversation

@marcauberer

Copy link
Copy Markdown
Contributor

LLVM 23 makes -use-constant-fp-for-fixed-length-splat the default, so a fixed-length vector splat such as <4 x float> splat (float -0.0) is now a ConstantFP that carries a vector type rather than a ConstantVector.

const_to_bytes assumed that a successful cast to ConstantInt/ConstantFP implied a scalar constant, and passed the scalar APInt together with the vector's alloc size to StoreIntToMemory. That trips the "Integer too small!" assertion and aborts tpde-encodegen while emitting the encode templates (e.g. for fneg/fabs/copysign, whose sign masks are splats).

Expand such splats element-wise before the scalar cases can misread them.

Fixes #47

LLVM 23 makes -use-constant-fp-for-fixed-length-splat the default, so a
fixed-length vector splat such as `<4 x float> splat (float -0.0)` is now
a ConstantFP that carries a vector type rather than a ConstantVector.

const_to_bytes assumed that a successful cast to ConstantInt/ConstantFP
implied a scalar constant, and passed the scalar APInt together with the
vector's alloc size to StoreIntToMemory. That trips the "Integer too
small!" assertion and aborts tpde-encodegen while emitting the encode
templates (e.g. for fneg/fabs/copysign, whose sign masks are splats).

Expand such splats element-wise before the scalar cases can misread them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure with LLVM 23 non-release build

1 participant