Repository navigation
Conversation
Symbolic vectors must use the same layout whether they are loaded from memory or built by insertelement/arithmetic. On little-endian targets, loads and stores treat a vector like an integer of the same width (lane 0 in the least significant bits), while the extract/insert/concat code in PR eurecom-s3#191 assumes the struct layout (lane 0 first, lanes byte-swapped), so the solver reasons about the wrong lane or about byte-swapped lanes. The test checks the exact solutions with the simple backend and uses a test-case handler to verify generated inputs with the QSYM backend. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Adds
test/vector_endianness.ll, a regression test for the vector layout issue described in item 1 of the review on #191.On little-endian targets, loads and stores treat a vector like an integer of the same width: lane 0 is in the least significant bits, as with
bitcast <4 x i32> to i128. The extract/insert/concat code in eurecom-s3#191 assumes the struct layout instead (lane 0 first, lanes byte-swapped). So the solver reasons about the wrong lane, or about byte-swapped lane values.The test treats 16 symbolic bytes as a
<4 x i32>and covers three patterns, each on its own lane so every correct solution is unique:extractelementlane 1== 0x1122334444 33 22 11add1 (carry crosses a byte) → vector store → scalar load of lane 2== 0x100ff 00 00 00insertelementinto lane 3 → vector store → scalar load of lane 3== 0x5566778888 77 66 55sN solvedonly if a generated input actually satisfies scenario N.Status: this test fails on the current branch by design. It should pass once vectors use the same layout as loads, stores and bitcasts.
stdin8..11 = 11 22 33 44(lane 2, reversed) instead ofstdin4..7 = 44 33 22 11.s1 solved, which shows the handler logic works.Tested with LLVM 15 (the project's Docker builder image).
🤖 Generated with Claude Code