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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to