[llvm] [Docs] Fix GEP type in example (PR #68533)

Mariusz Sikora via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 8 13:37:07 PDT 2023


================
@@ -200,7 +200,7 @@ fine:
 
   @MyVar = external global { i32, [40 x i32 ] }
   ...
-  %idx = getelementptr { [40 x i32] }, ptr @MyVal, i64 0, i32 1, i64 17
+  %idx = getelementptr { i32, [40 x i32] }, ptr @MyVal, i64 0, i32 1, i32 0, i64 17
----------------
mariusz-sikora-at-amd wrote:

You are probably right. I pushed first patch without this extra `i32 0`. But later I was influenced by `%idx1 = getelementptr { [10 x i32] }, ptr @MyVar, i64 0, i32 0, i64 1` which is in next paragraph. Is this `i32 0` also invalid (in `[Why don’t GEP x,0,0,1 and GEP x,1 alias?](https://llvm.org/docs/GetElementPtr.html#id7)`?


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


More information about the llvm-commits mailing list