Skip to content

Commit 7a0cd11

Browse files
committed
Bump externals/llvm-project to 0f3ca6bb9ca514518c55fc02855a6083312ddfe2 and migrate to the new MLIR complex element type API. LLVM commit 0ff5c32c2821 changed the `DenseElementsAttr::get` complex overloads to take `ArrayRef<mlir::Complex<T>>` instead of `ArrayRef<std::complex<T>>`. For `T = APFloat`, `mlir::Complex<T>` resolves to `NonFloatComplex<T>` since APFloat does not satisfy `std::is_floating_point_v`, so the existing call site in `TorchToLinalg/Linear.cpp` (FFT DFT matmul coefficient) no longer compiles. We need to replace `std::complex<APFloat>` with `mlir::Complex<APFloat>` for the `SmallVector` element type and the per-element constructor in `getDFTMatmulCoeff`.
1 parent 46cbd27 commit 7a0cd11

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎.gitmodules‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/llvm/llvm-project.git
44
[submodule "externals/stablehlo"]
55
path = externals/stablehlo
6-
url = https://github.com/openxla/stablehlo.git
6+
url = https://github.com/iree-org/stablehlo.git

‎externals/llvm-project‎

Submodule llvm-project updated 10285 files

‎lib/Conversion/TorchToLinalg/Linear.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2346,7 +2346,7 @@ Value getDFTMatmulCoeff(OpBuilder b, Location loc,
23462346
// scale = 2 * pi / N
23472347
double scale = 2 * llvm::numbers::pi / matrixType.getDimSize(0);
23482348

2349-
SmallVector<std::complex<APFloat>> values;
2349+
SmallVector<mlir::Complex<APFloat>> values;
23502350
for (auto i : llvm::seq<unsigned>(0, matrixType.getDimSize(0))) {
23512351
for (auto j : llvm::seq<unsigned>(0, matrixType.getDimSize(1))) {
23522352
double v = scale * i * j;
@@ -2361,7 +2361,7 @@ Value getDFTMatmulCoeff(OpBuilder b, Location loc,
23612361
imag.convert(floatType.getFloatSemantics(), APFloat::rmNearestTiesToEven,
23622362
&unused);
23632363

2364-
values.push_back(std::complex<APFloat>(real, imag));
2364+
values.push_back(mlir::Complex<APFloat>(real, imag));
23652365
}
23662366
}
23672367
return arith::ConstantOp::create(b, loc, matrixType,

0 commit comments

Comments
 (0)