[Hexagon] Specify vector alignment in DataLayout string
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 12 Feb 2016 14:47:38 +0000 (14:47 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 12 Feb 2016 14:47:38 +0000 (14:47 +0000)
commite59964377cdf3b716d2792d22cf7235bc6a3ef58
tree6f12f07ccbf67c4aa39cda7624ff67412cb59ff0
parent74bcf03f873987c8bf4f090308649b85860b9228
[Hexagon] Specify vector alignment in DataLayout string

The DataLayout can calculate alignment of vectors based on the alignment
of the element type and the number of elements. In fact, it is the product
of these two values. The problem is that for vectors of N x i1, this will
return the alignment of N bytes, since the alignment of i1 is 8 bits. The
vector types of vNi1 should be aligned to N bits instead. Provide explicit
alignment for HVX vectors to avoid such complications.

llvm-svn: 260678
llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
llvm/test/CodeGen/Hexagon/vector-align.ll [new file with mode: 0644]