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

Lower smulo codegen opcode #613

Open
vladimirradosavljevic opened this issue Jun 11, 2024 · 0 comments
Open

Lower smulo codegen opcode #613

vladimirradosavljevic opened this issue Jun 11, 2024 · 0 comments

Comments

@vladimirradosavljevic
Copy link
Contributor

vladimirradosavljevic commented Jun 11, 2024

For the following test:

target datalayout = "E-p:256:256-i256:256:256-S32-a:256:256"
target triple = "eravm"

declare { i256, i1 } @llvm.smul.with.overflow.i256(i256, i256)

define i256 @test(i256 %a, i256 %b, i256 %x, i256 %y) {
entry:
  %smul = call {i256, i1} @llvm.smul.with.overflow.i256(i256 %x, i256 %y)
  %overflow = extractvalue {i256, i1} %smul, 1
  %select = select i1 %overflow, i256 %a, i256 %b
  ret i256 %select
}

we are currently hitting the assert (Assertion failed: (LC != RTLIB::UNKNOWN_LIBCALL && "Cannot expand this operation!"), function expandMULO), since we don't support lowering of smulo codegen opcode.
Possible solution is here.

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

No branches or pull requests

1 participant