Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support changes to getelementptr instruction in LLVM 19 #279

Open
RyanGlScott opened this issue Sep 25, 2024 · 0 comments
Open

Support changes to getelementptr instruction in LLVM 19 #279

RyanGlScott opened this issue Sep 25, 2024 · 0 comments

Comments

@RyanGlScott
Copy link
Contributor

If you attempt to compile the following LLVM bitcode using llvm-as-19.1.0 and then parse it using llvm-pretty-bc-parser, it will fail:

%struct.RT = type { i8, [10 x [20 x i32]], i8 }
%struct.ST = type { i32, double, %struct.RT }

define ptr @foo(ptr %s) {
entry:
  %arrayidx = getelementptr inbounds %struct.ST, ptr %s, i64 1, i32 2, i32 1, i64 5, i64 13
  ret ptr %arrayidx
}
λ> parseBitCodeFromFile "test.bc"
Left (Error {errContext = ["FUNC_CODE_INST_GEP","@foo","FUNCTION_BLOCK","FUNCTION_BLOCK_ID","value symbol table","MODULE_BLOCK","Bitstream"], errMessage = "parseField: unable to parse record field 0 of record Record {recordCode = 43, recordFields = [FieldFixed (BitString {bsLength = NumBits 3, bsData = 3}),FieldFixed (BitString {bsLength = NumBits 4, bsData = 10}),FieldVBR (BitString {bsLength = NumBits 5, bsData = 6}),FieldVBR (BitString {bsLength = NumBits 5, bsData = 5}),FieldVBR (BitString {bsLength = NumBits 5, bsData = 4}),FieldVBR (BitString {bsLength = NumBits 5, bsData = 3}),FieldVBR (BitString {bsLength = NumBits 5, bsData = 2}),FieldVBR (BitString {bsLength = NumBits 5, bsData = 1})]}"})

I'm not entirely sure what is going on yet, but I suspect it is related to the changes brought about by this proposal. (See also #278, which is about constant getelementptr expressions rather than getelementptr instructions.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant