forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Multiplication instructions generated for target that does not support them #124
Comments
Here's a reproduction declare {i8, i1 } @llvm.umul.with.overflow.i8(i8, i8)
define {i8, i1} @test(i8 %a) {
%1 = call addrspace(1) { i8, i1 } @llvm.umul.with.overflow.i8(i8 %a, i8 13)
ret {i8, i1} %1
} Compile with ./bin/llc -march=avr -mcpu=attiny85 test.ll -o - Outputs
|
I think I've seen a |
bogner
pushed a commit
to bogner/llvm-zipper-prototype
that referenced
this issue
Jan 18, 2019
…ave hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351523 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-git-migration
pushed a commit
to llvm/llvm-project
that referenced
this issue
Jan 18, 2019
…ave hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124. llvm-svn: 351523
Fixed in upstream LLVM at llvm-project/llvm-project-20170507@a684637f8b667527882ac4f50ea9ecb482e248aa. |
dylanmckay
pushed a commit
to avr-rust/llvm
that referenced
this issue
Jan 18, 2019
…ave hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351523 91177308-0d34-0410-b5e6-96231b3b80d8
earl
pushed a commit
to earl/llvm-mirror
that referenced
this issue
Jan 18, 2019
…ave hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351523 91177308-0d34-0410-b5e6-96231b3b80d8
dylanmckay
added a commit
that referenced
this issue
Jan 18, 2019
Cherry-picked in a3b0834 |
dylanmckay
pushed a commit
to dylanmckay/llvm
that referenced
this issue
Jan 20, 2019
…ave hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351523 91177308-0d34-0410-b5e6-96231b3b80d8
dylanmckay
added a commit
to dylanmckay/llvm
that referenced
this issue
Jan 20, 2019
…ave hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124.
llvm-git-migration
pushed a commit
to llvm/llvm-project
that referenced
this issue
May 23, 2019
------------------------------------------------------------------------ r351523 | dylanmckay | 2019-01-17 22:10:41 -0800 (Thu, 17 Jan 2019) | 12 lines [AVR] Expand 8/16-bit multiplication to libcalls on MCUs that don't have hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124. ------------------------------------------------------------------------ llvm-svn: 361551
dtzWill
pushed a commit
to llvm-mirror/llvm
that referenced
this issue
May 23, 2019
------------------------------------------------------------------------ r351523 | dylanmckay | 2019-01-17 22:10:41 -0800 (Thu, 17 Jan 2019) | 12 lines [AVR] Expand 8/16-bit multiplication to libcalls on MCUs that don't have hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_80@361551 91177308-0d34-0410-b5e6-96231b3b80d8
ajohnson-uoregon
pushed a commit
to ajohnson-uoregon/clang-rewrite-only
that referenced
this issue
Jul 17, 2022
------------------------------------------------------------------------ r351523 | dylanmckay | 2019-01-17 22:10:41 -0800 (Thu, 17 Jan 2019) | 12 lines [AVR] Expand 8/16-bit multiplication to libcalls on MCUs that don't have hardware MUL This change modifies the LLVM ISel lowering settings so that 8-bit/16-bit multiplication is expanded to calls into the compiler runtime library if the MCU being targeted does not support multiplication in hardware. Before this, MUL instructions would be generated on CPUs like the ATtiny85, triggering a CPU reset due to an illegal instruction at runtime. First raised in avr-rust/rust-legacy-fork#124. ------------------------------------------------------------------------ llvm-svn: 361551
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When compiling the following code:
using
rustc --target=avr-attiny85 main.rs --emit=asm
and the following target:LLVM emits a
mul
instruction, even though they are not supported onattiny85
.Unfortunately I don't have llvm tools available right now, to reduce the IR. I guess this is the responsible line:
The text was updated successfully, but these errors were encountered: