forked from rust-lang/llvm
-
Notifications
You must be signed in to change notification settings - Fork 3
Fix for avr-rust issue 129 #9
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
Closed
carlos4242
wants to merge
3
commits into
avr-rust:avr-rust-2019-01-18
from
carlos4242:avr-issue-129-patch-2
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
; RUN: llc -O1 < %s -march=avr | FileCheck %s | ||
|
||
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-apple-macosx10.9" | ||
|
||
%Vs6UInt16 = type <{ i16 }> | ||
%Sb = type <{ i1 }> | ||
|
||
define hidden void @_TF4main13setServoAngleFT5angleVs6UInt16_T_(i16) #0 { | ||
carlos4242 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
; CHECK-LABEL: entry | ||
entry: | ||
%adjustedAngle = alloca %Vs6UInt16, align 2 | ||
%1 = bitcast %Vs6UInt16* %adjustedAngle to i8* | ||
%adjustedAngle._value = getelementptr inbounds %Vs6UInt16, %Vs6UInt16* %adjustedAngle, i32 0, i32 0 | ||
store i16 %0, i16* %adjustedAngle._value, align 2 | ||
|
||
;print(unsignedInt: adjustedAngle &* UInt16(11)) | ||
; breaks here | ||
%adjustedAngle._value2 = getelementptr inbounds %Vs6UInt16, %Vs6UInt16* %adjustedAngle, i32 0, i32 0 | ||
%2 = load i16, i16* %adjustedAngle._value2, align 2 | ||
|
||
; CHECK: mov r22, r24 | ||
dylanmckay marked this conversation as resolved.
Show resolved
Hide resolved
|
||
; CHECK: mov r23, r25 | ||
|
||
; CHECK-DAG: ldi r20, 0 | ||
; CHECK-DAG: ldi r21, 0 | ||
; CHECK-DAG: ldi r18, 11 | ||
; CHECK-DAG: ldi r19, 0 | ||
|
||
; CHECK: mov r24, r20 | ||
; CHECK: mov r25, r21 | ||
; CHECK: call __mulsi3 | ||
%3 = call { i16, i1 } @llvm.umul.with.overflow.i16(i16 %2, i16 11) | ||
%4 = extractvalue { i16, i1 } %3, 0 | ||
%5 = extractvalue { i16, i1 } %3, 1 | ||
|
||
; above code looks fine, how is it lowered? | ||
%6 = call i1 @_TIF3AVR5printFT11unsignedIntVs6UInt1610addNewlineSb_T_A0_() | ||
call void @_TF3AVR5printFT11unsignedIntVs6UInt1610addNewlineSb_T_(i16 %4, i1 %6) | ||
|
||
; CHECK: ret | ||
ret void | ||
} | ||
|
||
declare void @_TF3AVR5printFT11unsignedIntVs6UInt1610addNewlineSb_T_(i16, i1) #0 | ||
carlos4242 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
declare i1 @_TIF3AVR5printFT11unsignedIntVs6UInt1610addNewlineSb_T_A0_() #0 | ||
|
||
; Function Attrs: nounwind readnone speculatable | ||
declare { i16, i1 } @llvm.umul.with.overflow.i16(i16, i16) #2 | ||
|
||
attributes #0 = { "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "target-cpu"="core2" "target-features"="+ssse3,+cx16,+fxsr,+mmx,+x87,+sse,+sse2,+sse3" } | ||
carlos4242 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
attributes #2 = { nounwind readnone speculatable } |
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.
Uh oh!
There was an error while loading. Please reload this page.