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

Type error parsing certain store operations on vector types #135

Open
atomb opened this issue Sep 30, 2019 · 3 comments
Open

Type error parsing certain store operations on vector types #135

atomb opened this issue Sep 30, 2019 · 3 comments

Comments

@atomb
Copy link
Contributor

atomb commented Sep 30, 2019

When parsing a simple .ll file using store on vector types, assembled with llvm-as 9.0.0, I get the following error:

Expected first value to be a pointer to some type <ty>, and for the second value to be a value of type <ty>.
Instruction signature: store : <ty> <value>, <ty>* <pointer>
Pointer type:  PtrTo (Vector 2 (PtrTo (PrimType (Integer 8))))
Value type:    PtrTo (PrimType (Integer 8))
Pointer value: ValIdent (Ident "9")
Value value:   ValIdent (Ident "8")

from:
	FUNC_CODE_INST_STORE
	@foo
	FUNCTION_BLOCK
	FUNCTION_BLOCK_ID
	value symbol table
	MODULE_BLOCK
	Bitstream

The contents of the .ll file are:

; ModuleID = 'foo.bc'
source_filename = "src/misc/extra/extraUtilMisc.c"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.14.0"

declare noalias i8* @malloc(i64) local_unnamed_addr #8
define void @foo(i32** nocapture readnone, i8*** nocapture readnone, i8** nocapture readnone) local_unnamed_addr #3 {
  %4 = tail call i8* @malloc(i64 4096) #16
  %5 = bitcast i8* %4 to i8**
  %6 = insertelement <2 x i8*> undef, i8* %4, i32 0
  %7 = shufflevector <2 x i8*> %6, <2 x i8*> undef, <2 x i32> zeroinitializer
  %8 = getelementptr i8, <2 x i8*> %7, <2 x i64> <i64 2048, i64 2056>
  %9 = bitcast i8* %4 to <2 x i8*>*
  store <2 x i8*> %8, <2 x i8*>* %9, align 8
  ret void
}

This seems related to #118.

@langston-barrett
Copy link
Contributor

I also ran into this. Unfortunately, I can't share the bitcode module.

[Crux] Expected first value to be a pointer to some type <ty>, and for the second value to be a value of type <ty>.
Instruction signature: store : <ty> <value>, <ty>* <pointer>
Pointer type:  PtrTo (Vector 2 (PtrTo (PrimType (Integer 8))))
Value type:    PtrTo (PrimType (Integer 8))
Pointer value: ValIdent (Ident "49")
Value value:   ValIdent (Ident "48")

from:
    FUNC_CODE_INST_STORE
    @some_function
    FUNCTION_BLOCK
    FUNCTION_BLOCK_ID
    value symbol table
    MODULE_BLOCK
    Bitstream

@langston-barrett
Copy link
Contributor

FWIW, I just disabled this check and saw an error pop up downstream in Crucible:

user error (Failure encountered while generating a Crucible CFG: at src/ls.c:3965:39: Unexpected failure when evaluating GEP
getelementptr %struct.fileinfo, %struct.fileinfo* %20,
                                <2 x i64> %34
)

ls.bc.zip

@langston-barrett
Copy link
Contributor

The following Clang flags can help avoid this problem: -fno-slp-vectorize -fno-vectorize.

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

No branches or pull requests

2 participants