[LLVMdev] Proper arguments for -march?

H. Johnson misc at faradayco.com
Fri Nov 14 07:57:38 PST 2008


llc -march=x86 tempfileB.bc yields:
llc: for the -march option: : Cannot find option named 'x86'!

Windows build using Visual Studio 2008 Express with CMake.

clang and other tools seem to also complain about the format of -march, 
but other command line arguments seem to be working.   Tools, clang 
llvm-as, opt, etc., "seem" to be working.

Incidently, the bytecode file was built using this command:
clang test1.c -emit-llvm > tempfileA
llvm-as < tempfileA > tempfileB.bc


Contents of tempfileA is:
; ModuleID = 'test1.c'
target datalayout = 
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-win32"

define i32 @main(...) nounwind {
entry:
    %retval = alloca i32        ; <i32*> [#uses=1]
    %i = alloca i32, align 4        ; <i32*> [#uses=5]
    %j = alloca i32, align 4        ; <i32*> [#uses=1]
    store i32 0, i32* %i
    br label %for.cond

for.cond:        ; preds = %for.inc, %entry
    %tmp = load i32* %i        ; <i32> [#uses=1]
    %cmp = icmp slt i32 %tmp, 10        ; <i1> [#uses=1]
    br i1 %cmp, label %for.body, label %for.end

for.body:        ; preds = %for.cond
    %tmp1 = load i32* %i        ; <i32> [#uses=1]
    %add = add i32 %tmp1, 5        ; <i32> [#uses=1]
    store i32 %add, i32* %j
    br label %for.inc

for.inc:        ; preds = %for.body
    %tmp2 = load i32* %i        ; <i32> [#uses=1]
    %inc = add i32 %tmp2, 1        ; <i32> [#uses=1]
    store i32 %inc, i32* %i
    br label %for.cond

for.end:        ; preds = %for.cond
    br label %return

return:        ; preds = %for.end
    %0 = load i32* %retval        ; <i32> [#uses=1]
    ret i32 %0
}








More information about the llvm-dev mailing list