Commit a8f9271
authored
[mlir][Vector] Fix vector.extract lowering to llvm for 0-d vectors (#117731)
The current implementation of lowering to llvm for vector.extract
incorrectly assumes that if the number of indices is zero, the operation
can be folded away. This PR removes this condition and relies on the
folder to do it instead.
This PR also unifies the logic for scalar extracts and slice extracts,
which as a side effect also enables vector.extract lowering for n-d
vector.extract with dynamic inner most dimension. (This was only
prevented by a conservative check in the old implementation)1 parent bb9bb68 commit a8f9271
File tree
2 files changed
+91
-37
lines changed- mlir
- lib/Conversion/VectorToLLVM
- test/Conversion/VectorToLLVM
2 files changed
+91
-37
lines changedLines changed: 42 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1096 | 1096 | | |
1097 | 1097 | | |
1098 | 1098 | | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1118 | 1123 | | |
1119 | 1124 | | |
1120 | | - | |
1121 | 1125 | | |
1122 | | - | |
1123 | | - | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
1124 | 1136 | | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
1125 | 1141 | | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1130 | 1145 | | |
1131 | 1146 | | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
| 1147 | + | |
1136 | 1148 | | |
1137 | 1149 | | |
1138 | 1150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1290 | 1290 | | |
1291 | 1291 | | |
1292 | 1292 | | |
1293 | | - | |
| 1293 | + | |
1294 | 1294 | | |
1295 | 1295 | | |
1296 | 1296 | | |
1297 | 1297 | | |
1298 | | - | |
| 1298 | + | |
| 1299 | + | |
1299 | 1300 | | |
1300 | | - | |
1301 | | - | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
1302 | 1304 | | |
1303 | | - | |
| 1305 | + | |
1304 | 1306 | | |
1305 | 1307 | | |
1306 | 1308 | | |
1307 | 1309 | | |
1308 | | - | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
1309 | 1318 | | |
1310 | | - | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
1311 | 1328 | | |
1312 | 1329 | | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1313 | 1355 | | |
1314 | 1356 | | |
1315 | 1357 | | |
| |||
0 commit comments