[llvm-dev] Help on finding Base GEP

Venkataramanan Kumar via llvm-dev llvm-dev at lists.llvm.org
Wed May 30 03:59:54 PDT 2018


Hi,

Below is the snippet of  LLVM IR code generated by Flang

---snip--
  %3 = getelementptr i64, i64* %"a$sd", i64 11, !dbg !16
  %4 = bitcast i64* %3 to i32*, !dbg !16
  %5 = load i32, i32* %4, align 4, !dbg !16, !tbaa !22
---snip--

My requirement is for any such LoadInst (example: %5),  I want to check if
its base GEP (i.e. %3) loads at particular offset (11) from its
corresponding arrays descriptor structure (a$sd).

is there any API in LLVM to check this? or I need to write my own?

regards,
Venkat.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180530/d91dc4d9/attachment.html>


More information about the llvm-dev mailing list