[PATCH] D123300: [Clang] Enable opaque pointers by default

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 07:25:10 PDT 2022


markus added a comment.

With

  $ ./bin/clang -cc1 -emit-llvm BBI-68673.c

the IR contains the following

  @a2_ldm_i64 = global [4 x [18 x { i64, i64 }]] zeroinitializer, align 16
  %arrayidx = getelementptr inbounds [4 x [18 x { i64, i64 }]], ptr @a2_ldm_i64, i64 0, i64 %idxprom
  %.real = load volatile i64, ptr getelementptr inbounds ([18 x { i64, i64 }], ptr @a2_ldm_i64, i64 0, i64 1), align 16

but I would expect both GEPs to have the same first argument type (as the global symbol)

If I on the other hand compile with

  $ ./bin/clang -cc1 -emit-llvm -no-opaque-pointers BBI-68673.c

I instead get

  @a2_ldm_i64 = global [4 x [18 x { i64, i64 }]] zeroinitializer, align 16
  %arrayidx = getelementptr inbounds [4 x [18 x { i64, i64 }]], [4 x [18 x { i64, i64 }]]* @a2_ldm_i64, i64 0, i64 %idxprom
  %.real = load volatile i64, i64* getelementptr inbounds ([4 x [18 x { i64, i64 }]], [4 x [18 x { i64, i64 }]]* @a2_ldm_i64, i64 0, i64 0, i64 1, i32 0), align 16

which looks more consistent.

Any idea what is going on here?

F22817439: BBI-68673.c <https://reviews.llvm.org/F22817439>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123300



More information about the llvm-commits mailing list