llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Resolve the meaning of <N x i1>

Open hfinkel opened this issue 13 years ago • 3 comments

Bugzilla Link 15131
Resolution DUPLICATE
Resolved on Feb 28, 2013 23:16
Version trunk
OS Linux
CC @delena,@darkbuck

Extended Description

LLVM has supported types, and the code generator now has vNi1 types, the meaning of these types is not clear.

Moreover, the current types code is inconsistent with the code generation. Getting the storage size of v4i1 will return 1 byte (because the 4 bits are rounded up to 1 byte), but if you run: @​X = global <4 x i1> <i1 0, i1 1, i1 2, i1 3>

through llc (for x86_64 or anything else), you'll get something which looks like: X: .byte 0 # 0x0 .byte 1 # 0x1 .byte 0 # 0x0 .byte 1 # 0x1 .size X, 4

This should probably be changed to pack the bits together (to more naturally support mask registers on some targets).

FWIW, the default expansions of things like extract vector element in the DAG legalizer are also broken for vNi1 types.

hfinkel avatar Jan 31 '13 21:01 hfinkel

mentioned in issue llvm/llvm-project#2156

llvmbot avatar Nov 26 '21 18:11 llvmbot

patch to fix this bug only is submitted for review at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130225/167323.html

BTW, make it duplication of llvm/llvm-project#2156 may not be proper as llvm/llvm-project#2156 covers much more code/design than this specific bug. If possible, llvm/llvm-project#2156 should a parent bug and this one should be its child bug.

darkbuck avatar Mar 01 '13 07:03 darkbuck

*** This bug has been marked as a duplicate of bug llvm/llvm-project#2156 ***

llvmbot avatar Feb 20 '13 19:02 llvmbot