[llvm] [DataLayout] Remove i1 alignment entry (PR #156657)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 3 08:16:56 PDT 2025


nikic wrote:

> Not sure what the goal is here. It will reduce size of DefaultIntSpecs tables. But for targets that setup i1 alignment in the datalayout (not sure how common that is but afaict there are lots of test cases doing it), we would end up inserting elements at the beginning of the vector when parsing the datalayout (in setPrimitiveSpec). So we win some lose some.

The goal is to reduce the scan for finding the integer alignment by one. You're right that it doesn't help for targets that explicitly specify i1. (Though we could stop storing elements that have the same alignments as the following one.)

> Should we follow up and remove irrelevant entries for i1 in datalayouts (or maybe even clean that up as a first step)?

In theory, yes, but in practice changing data layout is quite disruptive, so I wouldn't do that unless we have to change it anyway for another reason.

https://github.com/llvm/llvm-project/pull/156657


More information about the llvm-commits mailing list