-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix logical or
/and
usage for MSVC compilation.
#3984
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `or`/`and` alternate spellings are not supported on all compilers without additinoal flags (https://learn.microsoft.com/en-us/cpp/cpp/logical-or-operator-pipe-pipe?view=msvc-170#operator-keyword-for-).
qedawkins
approved these changes
Jan 27, 2025
ScottTodd
added a commit
to iree-org/torch-mlir
that referenced
this pull request
Jan 27, 2025
The `or`/`and` alternate spellings are not supported on all compilers without additinoal flags (https://learn.microsoft.com/en-us/cpp/cpp/logical-or-operator-pipe-pipe?view=msvc-170#operator-keyword-for-). This code started producing errors in the downstream IREE project when building with MSVC on Windows: https://github.com/iree-org/iree/actions/runs/12985792116/job/36211327035#step:9:7446 ``` [6452/8792] Building CXX object compiler\plugins\input\Torch\torch-mlir\CMakeFiles\iree_compiler_plugins_input_Torch_torch-mlir_TorchDialectPasses.objects.dir\__\__\__\__\__\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp.obj FAILED: compiler/plugins/input/Torch/torch-mlir/CMakeFiles/iree_compiler_plugins_input_Torch_torch-mlir_TorchDialectPasses.objects.dir/__/__/__/__/__/third_party/torch-mlir/lib/Dialect/Torch/Transforms/DecomposeComplexOps.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\093843 -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\093843\compiler\plugins\input\Torch -IC:\home\runner\_work\iree\iree\third_party\llvm-project\llvm\include -IC:\mnt\azure\b\093843\llvm-project\include -IC:\home\runner\_work\iree\iree\third_party\llvm-project\mlir\include -IC:\mnt\azure\b\093843\llvm-project\tools\mlir\include -IC:\home\runner\_work\iree\iree\third_party\llvm-project\lld\include -IC:\mnt\azure\b\093843\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_TorchDialectPasses.objects.dir\__\__\__\__\__\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp.obj /Fdcompiler\plugins\input\Torch\torch-mlir\CMakeFiles\iree_compiler_plugins_input_Torch_torch-mlir_TorchDialectPasses.objects.dir\ /FS -c C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp(9783): error C2146: syntax error: missing ')' before identifier 'or' C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp(9783): error C2065: 'or': undeclared identifier C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp(9783): error C2146: syntax error: missing ';' before identifier 'selfRank' C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp(9783): error C2059: syntax error: ')' C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp(9784): error C2059: syntax error: 'return' C:\home\runner\_work\iree\iree\third_party\torch-mlir\lib\Dialect\Torch\Transforms\DecomposeComplexOps.cpp(9786): error C2059: syntax error: 'if' ```
ScottTodd
added a commit
to iree-org/iree
that referenced
this pull request
Jan 27, 2025
ita9naiwa
pushed a commit
to ita9naiwa/iree
that referenced
this pull request
Feb 4, 2025
See llvm/torch-mlir#3984 Signed-off-by: Hyunsung Lee <ita9naiwa@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
or
/and
alternate spellings are not supported on all compilers without additinoal flags (https://learn.microsoft.com/en-us/cpp/cpp/logical-or-operator-pipe-pipe?view=msvc-170#operator-keyword-for-).This code started producing errors in the downstream IREE project when building with MSVC on Windows: https://github.com/iree-org/iree/actions/runs/12985792116/job/36211327035#step:9:7446