As described in https://llvm.org/bugs/show_bug.cgi?id=24248, the scalarizer can cache incorrect entries when walking up a chain of insertelement instructions. This occurs when it encounters more than one instruction that it is not actively searching for, as it unconditionally caches every element it finds. The fix is to only cache the first element that it isn't searching for so we don't overwrite correct entries.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/Transforms/Scalarizer/cache-bug.ll | ||
---|---|---|
16 ↗ | (On Diff #30803) | We don't need to check the entire output here, we only need to check for the function name, this line, and perhaps the absence of the bad output (just to make it clear what is being tested). I'd write this: ; CHECK-LABEL: @func The problem with including the whole output verbatim is that any future simplifications, or even changes to how the variables are named, will break the test. Otherwise, LGTM. |