Skip to content
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

[CIR][ABI][NFC] Add CC lowering for void FuncOps #678

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

sitio-couto
Copy link
Collaborator

This patch implements the lowering of function definitions with no arguments and returns. In pratice, nothing has to be done (at least for the x86 ABI), so this case is used as a primer for the target lowering library since it helps populate the base logic for handling calling convention lowering of function definitions.

This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
@sitio-couto sitio-couto self-assigned this Jun 11, 2024
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor comment

@sitio-couto sitio-couto merged commit 901f532 into llvm:main Jun 11, 2024
7 checks passed
@sitio-couto sitio-couto deleted the vinicius/void-funcop-cc-lowering branch June 11, 2024 19:27
bcardosolopes added a commit that referenced this pull request Jun 17, 2024
This reverts commit 901f532.

Revert as a prereq to revert #668

This broke the build:
```
/usr/bin/ld: lib/libMLIRCIRTransforms.a(LoweringPrepare.cpp.o): in function `(anonymous namespace)::LoweringPreparePass::lowerVAArgOp(mlir::cir::VAArgOp)':
/local/home/dolsen/clangir/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp:340: undefined reference to `cir::CIRDataLayout::CIRDataLayout(mlir::ModuleOp)'
/usr/bin/ld: lib/libTargetLowering.a(LowerTypes.cpp.o): in function `cir::CIRDataLayout::CIRDataLayout(llvm::StringRef, mlir::ModuleOp)':
/local/home/dolsen/clangir/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h:31: undefined reference to `cir::CIRDataLayout::reset(llvm::StringRef)'`'
```

Steps to reproduce:
```
$ cmake -GNinja -DCMAKE_INSTALL_PREFIX=/<some-path>/clangir-install "-DLLVM_ENABLE_PROJECTS=clang;mlir" -DCLANG_ENABLE_CIR=ON -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Debug ../clangir/llvm
$ ninja install
```
sitio-couto added a commit to sitio-couto/clangir that referenced this pull request Jun 18, 2024
This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
sitio-couto added a commit to sitio-couto/clangir that referenced this pull request Jun 18, 2024
This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
bcardosolopes pushed a commit that referenced this pull request Jun 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Essentially re-applies #668 and #678, but also includes #687 which
patched build introduced by the other two PRs.

Closes #691
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
This reverts commit 901f532.

Revert as a prereq to revert llvm#668

This broke the build:
```
/usr/bin/ld: lib/libMLIRCIRTransforms.a(LoweringPrepare.cpp.o): in function `(anonymous namespace)::LoweringPreparePass::lowerVAArgOp(mlir::cir::VAArgOp)':
/local/home/dolsen/clangir/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp:340: undefined reference to `cir::CIRDataLayout::CIRDataLayout(mlir::ModuleOp)'
/usr/bin/ld: lib/libTargetLowering.a(LowerTypes.cpp.o): in function `cir::CIRDataLayout::CIRDataLayout(llvm::StringRef, mlir::ModuleOp)':
/local/home/dolsen/clangir/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h:31: undefined reference to `cir::CIRDataLayout::reset(llvm::StringRef)'`'
```

Steps to reproduce:
```
$ cmake -GNinja -DCMAKE_INSTALL_PREFIX=/<some-path>/clangir-install "-DLLVM_ENABLE_PROJECTS=clang;mlir" -DCLANG_ENABLE_CIR=ON -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Debug ../clangir/llvm
$ ninja install
```
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
Essentially re-applies llvm#668 and llvm#678, but also includes llvm#687 which
patched build introduced by the other two PRs.

Closes llvm#691
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
This reverts commit 901f532.

Revert as a prereq to revert llvm#668

This broke the build:
```
/usr/bin/ld: lib/libMLIRCIRTransforms.a(LoweringPrepare.cpp.o): in function `(anonymous namespace)::LoweringPreparePass::lowerVAArgOp(mlir::cir::VAArgOp)':
/local/home/dolsen/clangir/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp:340: undefined reference to `cir::CIRDataLayout::CIRDataLayout(mlir::ModuleOp)'
/usr/bin/ld: lib/libTargetLowering.a(LowerTypes.cpp.o): in function `cir::CIRDataLayout::CIRDataLayout(llvm::StringRef, mlir::ModuleOp)':
/local/home/dolsen/clangir/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h:31: undefined reference to `cir::CIRDataLayout::reset(llvm::StringRef)'`'
```

Steps to reproduce:
```
$ cmake -GNinja -DCMAKE_INSTALL_PREFIX=/<some-path>/clangir-install "-DLLVM_ENABLE_PROJECTS=clang;mlir" -DCLANG_ENABLE_CIR=ON -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Debug ../clangir/llvm
$ ninja install
```
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
Essentially re-applies llvm#668 and llvm#678, but also includes llvm#687 which
patched build introduced by the other two PRs.

Closes llvm#691
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
This reverts commit 901f532.

Revert as a prereq to revert llvm#668

This broke the build:
```
/usr/bin/ld: lib/libMLIRCIRTransforms.a(LoweringPrepare.cpp.o): in function `(anonymous namespace)::LoweringPreparePass::lowerVAArgOp(mlir::cir::VAArgOp)':
/local/home/dolsen/clangir/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp:340: undefined reference to `cir::CIRDataLayout::CIRDataLayout(mlir::ModuleOp)'
/usr/bin/ld: lib/libTargetLowering.a(LowerTypes.cpp.o): in function `cir::CIRDataLayout::CIRDataLayout(llvm::StringRef, mlir::ModuleOp)':
/local/home/dolsen/clangir/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h:31: undefined reference to `cir::CIRDataLayout::reset(llvm::StringRef)'`'
```

Steps to reproduce:
```
$ cmake -GNinja -DCMAKE_INSTALL_PREFIX=/<some-path>/clangir-install "-DLLVM_ENABLE_PROJECTS=clang;mlir" -DCLANG_ENABLE_CIR=ON -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Debug ../clangir/llvm
$ ninja install
```
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
Essentially re-applies llvm#668 and llvm#678, but also includes llvm#687 which
patched build introduced by the other two PRs.

Closes llvm#691
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
This reverts commit 901f532.

Revert as a prereq to revert llvm#668

This broke the build:
```
/usr/bin/ld: lib/libMLIRCIRTransforms.a(LoweringPrepare.cpp.o): in function `(anonymous namespace)::LoweringPreparePass::lowerVAArgOp(mlir::cir::VAArgOp)':
/local/home/dolsen/clangir/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp:340: undefined reference to `cir::CIRDataLayout::CIRDataLayout(mlir::ModuleOp)'
/usr/bin/ld: lib/libTargetLowering.a(LowerTypes.cpp.o): in function `cir::CIRDataLayout::CIRDataLayout(llvm::StringRef, mlir::ModuleOp)':
/local/home/dolsen/clangir/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h:31: undefined reference to `cir::CIRDataLayout::reset(llvm::StringRef)'`'
```

Steps to reproduce:
```
$ cmake -GNinja -DCMAKE_INSTALL_PREFIX=/<some-path>/clangir-install "-DLLVM_ENABLE_PROJECTS=clang;mlir" -DCLANG_ENABLE_CIR=ON -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Debug ../clangir/llvm
$ ninja install
```
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
Essentially re-applies llvm#668 and llvm#678, but also includes llvm#687 which
patched build introduced by the other two PRs.

Closes llvm#691
lanza pushed a commit that referenced this pull request Nov 5, 2024
This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
lanza pushed a commit that referenced this pull request Nov 5, 2024
This reverts commit 901f532.

Revert as a prereq to revert #668

This broke the build:
```
/usr/bin/ld: lib/libMLIRCIRTransforms.a(LoweringPrepare.cpp.o): in function `(anonymous namespace)::LoweringPreparePass::lowerVAArgOp(mlir::cir::VAArgOp)':
/local/home/dolsen/clangir/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp:340: undefined reference to `cir::CIRDataLayout::CIRDataLayout(mlir::ModuleOp)'
/usr/bin/ld: lib/libTargetLowering.a(LowerTypes.cpp.o): in function `cir::CIRDataLayout::CIRDataLayout(llvm::StringRef, mlir::ModuleOp)':
/local/home/dolsen/clangir/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h:31: undefined reference to `cir::CIRDataLayout::reset(llvm::StringRef)'`'
```

Steps to reproduce:
```
$ cmake -GNinja -DCMAKE_INSTALL_PREFIX=/<some-path>/clangir-install "-DLLVM_ENABLE_PROJECTS=clang;mlir" -DCLANG_ENABLE_CIR=ON -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Debug ../clangir/llvm
$ ninja install
```
lanza pushed a commit that referenced this pull request Nov 5, 2024
Essentially re-applies #668 and #678, but also includes #687 which
patched build introduced by the other two PRs.

Closes #691
lanza pushed a commit that referenced this pull request Mar 18, 2025
This patch implements the lowering of function definitions with no
arguments and returns. In pratice, nothing has to be done (at least for
the x86 ABI), so this case is used as a primer for the target lowering
library since it helps populate the base logic for handling calling
convention lowering of function definitions.
lanza pushed a commit that referenced this pull request Mar 18, 2025
This reverts commit 901f532.

Revert as a prereq to revert #668

This broke the build:
```
/usr/bin/ld: lib/libMLIRCIRTransforms.a(LoweringPrepare.cpp.o): in function `(anonymous namespace)::LoweringPreparePass::lowerVAArgOp(mlir::cir::VAArgOp)':
/local/home/dolsen/clangir/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp:340: undefined reference to `cir::CIRDataLayout::CIRDataLayout(mlir::ModuleOp)'
/usr/bin/ld: lib/libTargetLowering.a(LowerTypes.cpp.o): in function `cir::CIRDataLayout::CIRDataLayout(llvm::StringRef, mlir::ModuleOp)':
/local/home/dolsen/clangir/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h:31: undefined reference to `cir::CIRDataLayout::reset(llvm::StringRef)'`'
```

Steps to reproduce:
```
$ cmake -GNinja -DCMAKE_INSTALL_PREFIX=/<some-path>/clangir-install "-DLLVM_ENABLE_PROJECTS=clang;mlir" -DCLANG_ENABLE_CIR=ON -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Debug ../clangir/llvm
$ ninja install
```
lanza pushed a commit that referenced this pull request Mar 18, 2025
Essentially re-applies #668 and #678, but also includes #687 which
patched build introduced by the other two PRs.

Closes #691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants