The code in ConstantFoldGetElementPtr() assumes integer, and therefore it crashes trying to get the integer bidwith of a vector type (in this case <4 x i32>. I just changed the code to prevent the folding in case of vectors and I didn't bother to generalize as this doesn't seem to me something that really happens in practice, but I'm willing to change the patch if you think it's worth it.
This is hard to trigger from -instsimplify or -instcombine only as the second instruction is dead, so the test uses loop-unroll.
Details
Details
- Reviewers
efriedma RKSimon - Commits
- rGfa77bc40d400: Merging r309330: --------------------------------------------------------------…
rG1a26f24f3527: [ConstantFolder] Don't try to fold gep when the idx is a vector.
rL309595: Merging r309330:
rL309330: [ConstantFolder] Don't try to fold gep when the idx is a vector.
Diff Detail
Diff Detail