[PATCH] D158530: [InferAlignment] Create tests for InferAlignment pass

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 02:52:54 PDT 2023


nikic added inline comments.


================
Comment at: llvm/test/Transforms/InferAlignment/alloca.ll:47
+
+  %gep.0 = getelementptr %struct.pair, ptr %alloca.struct, i32 %x, i32 0
+  %gep.1 = getelementptr { i32, i32 }, ptr %gep.0, i32 %x
----------------
This is going to index outside the alloca. What you want here is something like `getelementptr %struct.pair, ptr %alloca.struct, i64 0, i32 1` which would skip over the first `{ i32, i32 }`, i.e. apply an 8 byte offset.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158530



More information about the llvm-commits mailing list