Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Function call support#477

Merged
georgemitenkov merged 7 commits into
llvmfrom
georgemitenkov/llvm-func-calls
Dec 30, 2020
Merged

Function call support#477
georgemitenkov merged 7 commits into
llvmfrom
georgemitenkov/llvm-func-calls

Conversation

@georgemitenkov
Copy link
Copy Markdown
Collaborator

@georgemitenkov georgemitenkov commented Dec 29, 2020

This patch introduces support for function call code generation, particularly:

  • User-defined procedures and functions are supported
  • Framework for external method has been created, currently support for exp and pow has been added

Added corresponding tests.

fixes #472

@bbpbuildbot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

Copy link
Copy Markdown
Contributor

@pramodk pramodk left a comment

Choose a reason for hiding this comment

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

nice! LGTM!

About Jenkins CI failure:

default — Build finished.

I am taking a look at this on internal CI node. There is some weird linker issue with Intel compiler. I will try to fix this by tomorrow otherwise we can merge this.


// Process each argument and add it to a vector to pass to the function call instruction. Note
// that type checks are not needed here as NMODL operates on doubles by default. If that was not
// the case, cast instructions had to be created.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If that was not the case, cast instructions had to be created.

this won't be required, at DSL level we will make sure to have correct types.

@pramodk
Copy link
Copy Markdown
Contributor

pramodk commented Dec 29, 2020

About Jenkins CI failure:
default — Build finished.
I am taking a look at this on internal CI node. There is some weird linker issue with Intel compiler. I will try to fix this by tomorrow otherwise we can merge this.

@georgemitenkov : to fix Jenkins build issue, you have to do small change:

$ git diff
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index d4b29bf..f0c2e95 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -98,6 +98,7 @@ if(NMODL_ENABLE_LLVM)
   add_executable(testllvm visitor/main.cpp codegen/llvm.cpp)
   target_link_libraries(
     testllvm
+    llvm_codegen
     codegen
     visitor
     symtab
@@ -105,7 +106,6 @@ if(NMODL_ENABLE_LLVM)
     util
     test_util
     printer
-    llvm_codegen
     ${NMODL_WRAPPER_LIBS}
     ${LLVM_LIBS_TO_LINK})
   set(CODEGEN_TEST testllvm)

The reason for this is that llvm_codegen library has dependency with codegen library (for CodegenHelperVisitor) and hence that needs to be linked after llvm_codegen (as we are building all static libraries). This error appears with Intel compiler (only) that we use under Jernkins CI.

By the way, I assume I mentioned previously how to check Jenkins CI logs. If not, here is summary :

  • Click on the Details link

image

  • Login via Gasper account

image

  • It will take you to Jenkins build. Click on the default link:

image

  • And then Console Output on left side bar

image

  • And if you scroll to the end of log, you should see the error:

image

Copy link
Copy Markdown
Contributor

@pramodk pramodk left a comment

Choose a reason for hiding this comment

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

CI now looks green!

@georgemitenkov georgemitenkov merged commit 183d647 into llvm Dec 30, 2020
@georgemitenkov georgemitenkov deleted the georgemitenkov/llvm-func-calls branch December 30, 2020 19:14
@georgemitenkov georgemitenkov linked an issue Jan 12, 2021 that may be closed by this pull request
pramodk pushed a commit that referenced this pull request Feb 23, 2021
This patch adds support for function call code generation, particularly:

- User-defined procedures and functions can now lowered to LLVM IR.
- A framework for external method calls (e.g. sin, exp, etc.) has been created, currently `exp` and `pow` are supported.
- Corresponding tests added.

fixes #472
pramodk pushed a commit that referenced this pull request May 8, 2021
This patch adds support for function call code generation, particularly:

- User-defined procedures and functions can now lowered to LLVM IR.
- A framework for external method calls (e.g. sin, exp, etc.) has been created, currently `exp` and `pow` are supported.
- Corresponding tests added.

fixes #472
pramodk pushed a commit that referenced this pull request Mar 8, 2022
This patch adds support for function call code generation, particularly:

- User-defined procedures and functions can now lowered to LLVM IR.
- A framework for external method calls (e.g. sin, exp, etc.) has been created, currently `exp` and `pow` are supported.
- Corresponding tests added.

fixes #472
iomaganaris pushed a commit that referenced this pull request May 10, 2022
This patch adds support for function call code generation, particularly:

- User-defined procedures and functions can now lowered to LLVM IR.
- A framework for external method calls (e.g. sin, exp, etc.) has been created, currently `exp` and `pow` are supported.
- Corresponding tests added.

fixes #472
iomaganaris pushed a commit that referenced this pull request May 12, 2022
This patch adds support for function call code generation, particularly:

- User-defined procedures and functions can now lowered to LLVM IR.
- A framework for external method calls (e.g. sin, exp, etc.) has been created, currently `exp` and `pow` are supported.
- Corresponding tests added.

fixes #472
iomaganaris pushed a commit that referenced this pull request Sep 15, 2022
This patch adds support for function call code generation, particularly:

- User-defined procedures and functions can now lowered to LLVM IR.
- A framework for external method calls (e.g. sin, exp, etc.) has been created, currently `exp` and `pow` are supported.
- Corresponding tests added.

fixes #472
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Function call support

3 participants