Commit 32bb956
Bad SLPVectorization shufflevector replacement, resulting in write to wrong memory location
We see that it might otherwise do:
%10 = getelementptr {}**, <2 x {}***> %9, <2 x i32> <i32 10, i32 4>
%11 = bitcast <2 x {}***> %10 to <2 x i64*>
...
%27 = extractelement <2 x i64*> %11, i32 0
%28 = bitcast i64* %27 to <2 x i64>*
store <2 x i64> %22, <2 x i64>* %28, align 4, !tbaa !2
Which is an out-of-bounds store (the extractelement got offset 10
instead of offset 4 as intended). With the fix, we correctly generate
extractelement for i32 1 and generate correct code.
Differential Revision: https://reviews.llvm.org/D106613
(cherry picked from commit e27a6db)1 parent 93edfb2 commit 32bb956
File tree
2 files changed
+20
-8
lines changed- llvm
- lib/Transforms/Vectorize
- test/Transforms/SLPVectorizer/X86
2 files changed
+20
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5430 | 5430 | | |
5431 | 5431 | | |
5432 | 5432 | | |
5433 | | - | |
5434 | | - | |
| 5433 | + | |
| 5434 | + | |
| 5435 | + | |
| 5436 | + | |
| 5437 | + | |
5435 | 5438 | | |
5436 | 5439 | | |
5437 | 5440 | | |
| |||
5474 | 5477 | | |
5475 | 5478 | | |
5476 | 5479 | | |
5477 | | - | |
5478 | | - | |
| 5480 | + | |
| 5481 | + | |
| 5482 | + | |
| 5483 | + | |
| 5484 | + | |
| 5485 | + | |
5479 | 5486 | | |
5480 | 5487 | | |
5481 | 5488 | | |
| |||
5577 | 5584 | | |
5578 | 5585 | | |
5579 | 5586 | | |
5580 | | - | |
5581 | | - | |
| 5587 | + | |
| 5588 | + | |
| 5589 | + | |
| 5590 | + | |
| 5591 | + | |
| 5592 | + | |
| 5593 | + | |
| 5594 | + | |
5582 | 5595 | | |
5583 | 5596 | | |
5584 | 5597 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
0 commit comments