[ENCODEGEN] Handle vector splat constants in constant pool - #48
Open
marcauberer wants to merge 1 commit into
Open
[ENCODEGEN] Handle vector splat constants in constant pool#48marcauberer wants to merge 1 commit into
marcauberer wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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