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

Invalid definition error in llvm-upgrade #1559

Closed
llvmbot opened this issue Feb 8, 2007 · 10 comments
Closed

Invalid definition error in llvm-upgrade #1559

llvmbot opened this issue Feb 8, 2007 · 10 comments
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm-tools All llvm tools that do not have corresponding tag

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 8, 2007

Bugzilla Link 1187
Resolution FIXED
Resolved on Feb 22, 2010 12:53
Version trunk
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

llvm-upgrade -emit-bytecode file.ll -o tst.bc
terminates with the following error:
llvm-upgrade: file.ll:258527: error: Reference to an invalid definition: 'hash'
of type 'i32 (i8 *, i32) *'

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 8, 2007

Hmm... attachment is > 1MB, so bugzilla complains that it's too large, sending
it to Reid.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 8, 2007

Mine.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 8, 2007

For the UnexpectedUndef.ll file, here's my analysis:

This file isn't in 1.9 LLVM assembly format. It uses i32 which is a 2.0 feature.
It also uses 2.0 identifier syntax (@name and @"name"). I have changed
llvm-upgrade to recognize (i1, i8, i16, i32 and i64) but there isn't much I can
do about @"name" .. its just not lexically compatable with 1.9 assembly.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 8, 2007

For the FunctionRedefinition.ll file, we get three symptoms:

  1. Rename warning:

warning: Renaming function 'cdrom_read_subchannel' as
'cdrom_read_subchannel.upgrd.806' may cause linkage errors

These can be safely ignored. llvm-upgrade is just telling you that it is
renaming something and if you link this module with something else that renaming
might cause problems. The upgraded program will either be okay as is or you will
need to manually rename these items back (after resolving naming conflicts).
This occurs when you have overloaded functions (same name, different type).

  1. Redefinition that should not cause an error:

error: Redefinition of function 'msf_to_lba'

This occurs when two external functions of the same name and type are
encountered. This was illegal in 1.9 and is illegal now. However, the two
functions in question here are both "internal" linkage. I will make llvm-upgrade
quietly rename one of these functions. This can't produce any linkage errors
because of the internal linkage type.

  1. Infinite loop after parsing in ResolveDefinitions.

This one has something to do with the csretcc upgrade to sret param attr. For
some reason its not finding the type and looping infinitely while trying to get
the type description. The solution is to fix the problem so it can correctly
cast the function type.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 8, 2007

The smbd.ll file has problem #​1 and #​3 from the last post.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 8, 2007

I have fixed the @"name" problem from UnexpectedUndef.ll, but now there's
another problem. For some reason it is not parsing i32 -1 correctly. I'm not
sure why.

I'll investigate these remaining items. In the mean time, here's a partial fix
that solves some of the issues:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070205/044130.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070205/044131.html

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 8, 2007

For UnexpectedUndef.ll, you will need to do some manual upgrades for things that
are not supported in 1.9, to wit:
a) %name = global i32 -1
--> i32 is accepted as uint and -1 is not valid for uint
b) define keywoard: just remove these from the file and it should be fine
c) put "implementation" keyword before the first function definition
This file is just too divergent from 1.9 assembly for it to handle properly. The
changes I've made should significantly reduce your editing burden.

llvm-upgrade now parses and upgrades smbd.ll (with some really nasty sret chagnes).

named-checkconf.ll now parses and upgrades correctly.

FunctionRedefinition.ll now parses and upgrades correctly.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 8, 2007

The basic block renaming has now been handled too.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm-tools All llvm tools that do not have corresponding tag
Projects
None yet
Development

No branches or pull requests

1 participant