Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

i1 values not being promoted to i8 in function arguments #173

Closed
shepmaster opened this issue Jan 18, 2016 · 3 comments
Closed

i1 values not being promoted to i8 in function arguments #173

shepmaster opened this issue Jan 18, 2016 · 3 comments

Comments

@shepmaster
Copy link

Assertion failed: (InVals.size() == Ins.size() && "LowerFormalArguments didn't emit the correct number of values!"), function LowerArguments, file /Users/shep/Projects/avr-rust/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp, line 7405.

When running llc -march=avr -mcpu=atmega328p -filetype=obj bug2.ll on

; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-i64:8:8-f32:8:8-f64:8:8-n8"
target triple = "avr-atmel-none"

define internal void @_ZN3ops16bool.BitOrAssign12bitor_assign20hf3e6510977e16c6cX4kE(i8* noalias dereferenceable(1), i1 zeroext) unnamed_addr #2 {
entry-block:
  ret void
}

This was an intermediate bugpoint result from reducing #172.

@dylanmckay
Copy link
Member

Reduced to:

define void @foo(i1) {
  ret void
}

Added test case test/CodeGen/AVR/lower-formal-arguments-assertion.ll in 5d82a27.

@dylanmckay
Copy link
Member

Changing i1 to i8 fixes the problem. This is probably caused by the fact that i1 is not a valid type on AVR, and we should be promoting it to i8.

@dylanmckay dylanmckay changed the title Assertion failure: LowerFormalArguments didn't emit the correct number of values at SelectionDAGBuilder.cpp:7405 i8 values not being promoted to i8 in function arguments Jan 19, 2016
@shepmaster
Copy link
Author

we should be promoting it to i8.

Based on my limited knowledge, it seems like that's happening. I'm guessing that stuff needs to be done elsewhere.

shepmaster added a commit to shepmaster/llvm that referenced this issue Jan 19, 2016
Integer division was rounding off `i1` to take 0 bytes.

Closes avr-llvm#173
@dylanmckay dylanmckay changed the title i8 values not being promoted to i8 in function arguments i1 values not being promoted to i8 in function arguments Jan 19, 2016
shepmaster added a commit to shepmaster/llvm that referenced this issue Jan 20, 2016
Integer division was rounding off `i1` to take 0 bytes.

Closes avr-llvm#173
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants