Open TomMD opened 7 years ago
Given the likely non-minimal rust:
pub fn f(x : i64) -> i32 { if x == 0 { return 1; } else { return 0; } }
Observe:
$ rustc --emit llvm-bc --crate-type lib simple.rs -o simple.bc $ llvm-disasm simple.bc > simple.ll $ llc-3.8 simple.ll llc-3.8: simple.ll:5:50: error: expected ')' at end of argument list define i32 @_ZN6simple1f17hb796044fc140b16aE(i64 %0) {
The llvm-dis tool differs from llvm-disasm here:
llvm pretty (llvm-disasm):
define i32 @_ZN6simple1f17hb796044fc140b16aE(i64 %0) { entry-block: %_0 = alloca i32, align 0 ...
LLVM (llvm-dis):
define i32 @_ZN6simple1f17hb796044fc140b16aE(i64) unnamed_addr #0 { entry-block: %_0 = alloca i32
So three things:
%0
unnamed_addr #0
align 0
If I remove the %0 name and the align 0 then the llvm-disasm output does compile.
Given the likely non-minimal rust:
Observe:
The llvm-dis tool differs from llvm-disasm here:
llvm pretty (llvm-disasm):
LLVM (llvm-dis):
So three things:
%0
name or not.unnamed_addr #0
(or not)align 0
(or not)If I remove the
%0
name and thealign 0
then the llvm-disasm output does compile.