You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix constexpr usage in TorchToLinalg/Pooling.cpp for MSVC. (#4086)
Fixes#4085.
Sample errors before:
https://github.com/iree-org/iree/actions/runs/13761122447/job/38477287335#step:9:7692
```
FAILED: compiler/plugins/input/Torch/torch-mlir/CMakeFiles/iree_compiler_plugins_input_Torch_torch-mlir_ConversionPasses.objects.dir/__/__/__/__/__/third_party/torch-mlir/lib/Conversion/TorchToLinalg/Pooling.cpp.obj
C:\ProgramData\chocolatey\bin\ccache "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\cl.exe" /nologo /TP -IC:\home\runner\_work\iree\iree -IC:\mnt\azure\b\095504 -IC:\home\runner\_work\iree\iree\third_party\torch-mlir\include -IC:\home\runner\_work\iree\iree\compiler\plugins\input\Torch -IC:\mnt\azure\b\095504\compiler\plugins\input\Torch -IC:\home\runner\_work\iree\iree\third_party\llvm-project\llvm\include -IC:\mnt\azure\b\095504\llvm-project\include -IC:\home\runner\_work\iree\iree\third_party\llvm-project\mlir\include -IC:\mnt\azure\b\095504\llvm-project\tools\mlir\include -IC:\home\runner\_work\iree\iree\third_party\llvm-project\lld\include -IC:\mnt\azure\b\095504\llvm-project\tools\lld\include /DWIN32 /D_WINDOWS /EHsc /Z7 /O2 /Ob1 -std:c++17 -MD /wd4996 /Zc:preprocessor /DWIN32_LEAN_AND_MEAN /DNOMINMAX /D_USE_MATH_DEFINES /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING /GR- /bigobj /W3 /wd4200 /wd4018 /wd4146 /wd4244 /wd4267 /wd4005 /wd4065 /wd4141 /wd4624 /wd4576 /wd5105 /showIncludes /Focompiler\plugins\input\Torch\torch-mlir\CMakeFiles\iree_compiler_plugins_input_Torch_torch-mlir_ConversionPasses.objects.dir\__\__\__\__\__\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp.obj /Fdcompiler\plugins\input\Torch\torch-mlir\CMakeFiles\iree_compiler_plugins_input_Torch_torch-mlir_ConversionPasses.objects.dir\ /FS -c C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp
C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp(1098): error C2131: expression did not evaluate to a constant
C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp(1098): note: failure was caused by a read of a variable outside its lifetime
C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp(1098): note: see usage of 'this'
C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp(1098): note: the template instantiation context (the oldest one first) is
C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp(1642): note: see reference to function template instantiation 'mlir::RewritePatternSet &mlir::RewritePatternSet::add<`anonymous-namespace'::ConvertAtenAvgPoolOp<mlir::torch::Torch::AtenAvgPool1dOp,mlir::linalg::PoolingNcwSumOp,1>,mlir::TypeConverter&,mlir::MLIRContext*&,void>(ConstructorArg,mlir::MLIRContext *&)' being compiled
with
[
ConstructorArg=mlir::TypeConverter &
]
C:\home\runner\_work\iree\iree\third_party\llvm-project\mlir\include\mlir/IR/PatternMatch.h(1003): note: see reference to class template instantiation '`anonymous-namespace'::ConvertAtenAvgPoolOp<mlir::torch::Torch::AtenAvgPool1dOp,mlir::linalg::PoolingNcwSumOp,1>' being compiled
C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp(988): note: while compiling class template member function 'llvm::LogicalResult `anonymous-namespace'::ConvertAtenAvgPoolOp<mlir::torch::Torch::AtenAvgPool1dOp,mlir::linalg::PoolingNcwSumOp,1>::matchAndRewrite(OpTy,mlir::torch::Torch::AtenAvgPool1dOp::Adaptor,mlir::ConversionPatternRewriter &) const'
with
[
OpTy=mlir::torch::Torch::AtenAvgPool1dOp
]
C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp(1067): note: while compiling class template member function 'std::optional<llvm::LogicalResult> `anonymous-namespace'::ConvertAtenAvgPoolOp<mlir::torch::Torch::AtenAvgPool1dOp,mlir::linalg::PoolingNcwSumOp,1>::createAvgPoolValueCountIncludePadFalseCase(bool,OpTy,mlir::torch::Torch::AtenAvgPool1dOp::Adaptor,mlir::ConversionPatternRewriter &,mlir::Value,mlir::Value,mlir::Value,mlir::Type,llvm::SmallVectorImpl<T> &,llvm::SmallVectorImpl<__int64> &,llvm::SmallVectorImpl<__int64> &,llvm::SmallVector<mlir::AffineMap,6> &,llvm::SmallVector<mlir::utils::IteratorType,12> &)'
with
[
OpTy=mlir::torch::Torch::AtenAvgPool1dOp,
T=mlir::Value
]
C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Conversion\TorchToLinalg\Pooling.cpp(1099): error C2039: 'getDivisorOverride': is not a member of 'mlir::torch::Torch::AtenAvgPool1dOp'
```
0 commit comments