Commit f215532
committed
Remove Bitcast -> llvm.memset optimization in reverse translation (intel#1447)
It is done in order to avoid llvm.memcpy -> llvm.memset transformation which can
be an incorrect assumption.
SPIR-V does not have a memset instruction, there is a direct mapping only for
`llvm.memcpy` to `OpCopyMemory*`.
To handle `llvm.memset`, the input LLVM IR is lowered by `SPIRVRegularizeLLVM`
pass. The mentioned optimization tried to restore the memset instruction but it
surely does not cover all the possible cases (e.g., memcpy is not a memset inst).
Possibly, the number of follow-up fixes for different corner cases can prove
that the optimization is not absolutely correct, and it's better to rely on
regularize pass.
Original commit:
KhronosGroup/SPIRV-LLVM-Translator@cebaf791 parent 664d87d commit f215532
File tree
4 files changed
+7
-26
lines changed- llvm-spirv
- lib/SPIRV
- test
- llvm-intrinsics
- transcoding
4 files changed
+7
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1756 | 1756 | | |
1757 | 1757 | | |
1758 | 1758 | | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
1765 | | - | |
1766 | | - | |
1767 | | - | |
1768 | | - | |
1769 | | - | |
1770 | | - | |
1771 | | - | |
1772 | | - | |
1773 | | - | |
1774 | | - | |
1775 | | - | |
1776 | | - | |
1777 | | - | |
1778 | | - | |
1779 | | - | |
1780 | | - | |
1781 | | - | |
1782 | 1759 | | |
1783 | 1760 | | |
1784 | 1761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
0 commit comments