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

1-bit types consume one byte of space, not zero #180

Merged
merged 1 commit into from
Jan 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Target/AVR/AVRISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,8 @@ bool AVRTargetLowering::isOffsetFoldingLegal(
static void parseFunctionArgs(const Function *F, const DataLayout *TD,
SmallVectorImpl<unsigned> &Out) {
for (Argument const &Arg : F->args()) {
unsigned Bytes = TD->getTypeSizeInBits(Arg.getType()) / 8;
Out.push_back(((Bytes == 1) || (Bytes == 2)) ? 1 : Bytes / 2);
unsigned Bytes = (TD->getTypeSizeInBits(Arg.getType()) + 7) / 8;
Out.push_back((Bytes + 1) / 2);
}
}

Expand Down
11 changes: 2 additions & 9 deletions test/CodeGen/AVR/lower-formal-arguments-assertion.ll
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
; RUN: llc < %s -march=avr | FileCheck %s
; XFAIL:

; Test case for an assertion error.
;
; Error:
; ```
; "LowerFormalArguments didn't emit the correct number of values!"
; ```
; in `lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp`

define void @foo(i1) {
; CHECK-LABEL: foo:
; CHECK: ret
ret void
}