Open Quuxplusone opened 4 years ago
Bugzilla Link | PR47568 |
Status | NEW |
Importance | P enhancement |
Reported by | Pengbin Feng (pfeng4@gmu.edu) |
Reported on | 2020-09-17 16:35:50 -0700 |
Last modified on | 2020-09-18 18:16:54 -0700 |
Version | 11.0 |
Hardware | PC Linux |
CC | craig.topper@gmail.com, llvm-bugs@lists.llvm.org |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I'm guessing a little here, but I think you have a .ll file compiled for 64-bit, but then you asked llc to compile it for 32-bit by specifying -march=x86. What happens if you use -march=x86_64?
When I execute llc -march=x86-64 arch/x86/kernel/cpu/bugs.ll -o
arch/x86/kernel/cpu/bugs.ll.o, the error is shown in the following.
error: invalid operand for inline asm constraint 'i' at line 2149555151.
I think the IR files are Platform independent.
How to decided that the IR files are compiled for 64-bit?
IR files are not platform independent. Variable alignment, how function arguments and return values are passed, and many other things can all be platform specific. Plus how many bits are used for C types like size_t are dependent on whether it was compiled for 32 or 64 bits.
You shouldn't need to provide -march at all. The first couple lines of the IR file should include a line that says "target triple" that should tell llc which architecture to use.
Does the code compile successfully to a .o file?