[PATCH] D112463: [LangRef] Remove incorrect vector alignment rules

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 09:31:02 PST 2021


frasercrmck added inline comments.


================
Comment at: llvm/unittests/IR/DataLayoutTest.cpp:94
+TEST(DataLayoutTest, VectorAlign) {
+  Expected<DataLayout> DL = DataLayout::parse("v128:128");
+  EXPECT_THAT_EXPECTED(DL, Succeeded());
----------------
aeubanks wrote:
> I'm not very familiar with vectors, but does this say that a 128-bit vector is a legal type? Then this wouldn't be testing the langref change.
Not legal as such, it just specifies the ABI alignment of 128-bit vectors. The test is confirming that a 1024-bit vector (`<128 x double>`) doesn't report the alignment of the largest vector smaller than this vector, as the DataLayout says/said it would. If so we'd expect to see the alignment we'd specified for `v128` (16 bytes/128 bits), when in fact we observe that it just returns the natural alignment of the vector: 128 bytes/1024 bits.

Perhaps the examples I'm using are needlessly confusing because I'm using 128 in a few places?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112463/new/

https://reviews.llvm.org/D112463



More information about the llvm-commits mailing list