[llvm-dev] DragonEgg for GCC v8.x and LLVM v6.x is just able to work (original) (raw)

Tobias Grosser via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 21 03:42:30 PDT 2017


On Mon, Aug 21, 2017, at 05:31, Leslie Zhai via llvm-dev wrote:

Hi LLVM and GCC developers,

My sincere thanks will goto: * Duncan, the core developer of llvm-gcc and dragonegg http://llvm.org/devmtg/2009-10/SandsLLVMGCCPlugin.pdf * David, the innovator and developer of GCC https://dmalcolm.fedorapeople.org/gcc/global-state/requirements.html and others who give me kind response for teaching me patiently and carefully about how to migrate GCC v4.8.x to GCC v8.x (git-20170818) DragonEgg has been migrated to GCC v8.x and LLVM v6.x (svn-r311142), but also able to work for GCC v4.8.x and LLVM v3.3 https://reviews.llvm.org/D35667 and it is just able to work now, for example:

Very interesting. We are still using dragonegg to process our weather modeling codes here at ETH / CSCS. Having it updated to work with latest LLVM will provide us with a current baseline which will also be helpful to evaluate flang further. Thanks a lot for your effort.

Best, Tobias

PS: Would be great to have a flang update on the mailing list as well. I will ask for this in a separate email.

_$CC -fplugin=./dragonegg.so _ _-fplugin-arg-dragonegg-debug-pass-arguments _ _-ftime-report _ _-fverbose-asm _ _-fplugin-arg-dragonegg-enable-gcc-optzns _ _-fplugin-arg-dragonegg-emit-ir _ _-S _ _test/hello.c _ -wrapper gdb,--args hello.s (LLVM IR, the extension name is not important) ; ModuleID = 'test/hello.c' sourcefilename = "test/hello.c" target triple = "x8664-redhat-linux" module asm "\09.ident\09\22GCC: (GNU) 6.4.1 20170727 (Red Hat 6.4.1-1) LLVM: 3.9.1\22" @func.2210 = internal localunnamedaddr constant [4 x i8] c"foo\00" @.cst = private localunnamedaddr constant [24 x i8] c"DEBUG: %s, line %d: %s\0A\00", align 8 @.cst.1 = private localunnamedaddr constant [13 x i8] c"test/hello.c\00", align 8 @.cst.2 = private localunnamedaddr constant [12 x i8] c"Leslie Zhai\00", align 8 @.cst.3 = private localunnamedaddr constant [20 x i8] c"%s: Hello World %d\0A\00", align 8 ; Function Attrs: nounwind uwtable define void @foo(...) unnamedaddr #0 { entry: %"ssa point" = bitcast i32 0 to i32 br label %"<bb 2>" "<bb 2>": ; preds = %entry %0 = call i32 (i8*, ...) @printf(i8* noalias getelementptr inbounds ([24 x i8], [24 x i8]* @.cst, i64 0, i64 0), [13 x i8]* @.cst.1, i32 4, [4 x i8]* @func.2210) #1 br label %return return: ; preds = %"<bb 2>" ret void } declare i32 @printf(i8*, ...) ; Function Attrs: nounwind uwtable define i32 @main(i32 %argc, i8** %argv) unnamedaddr #0 { entry: %argcaddr = alloca i32, align 4 %argvaddr = alloca i8**, align 8 %n = alloca i32 %s = alloca i8* %"" = alloca i32 %"alloca point" = bitcast i32 0 to i32 store i32 %argc, i32* %argcaddr, align 1 store i8** %argv, i8*** %argvaddr, align 1 %"ssa point" = bitcast i32 0 to i32 br label %"<bb 2>" "<bb 2>": ; preds = %entry %0 = call i32 (i8*, ...) @printf(i8* noalias getelementptr inbounds ([20 x i8], [20 x i8]* @.cst.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.cst.2, i64 0, i64 0), i32 1) #1 br label %"" "": ; preds = %"<bb 2>" store i32 0, i32* %"", align 1 br label %return return: ; preds = %"" %1 = load i32, i32* %"", align 4 ret i32 %1 } attributes #0 = { nounwind uwtable "no-frame-pointer-elim-non-leaf"="true" } attributes #1 = { nounwind } !llvm.module.flags = !{!0} !0 = !{i32 1, !"PIE Level", i32 2} $ llc hello.s .text .file "hello.s" # Start of file scope inline assembly .ident "GCC: (GNU) 6.4.1 20170727 (Red Hat 6.4.1-1) LLVM: 3.9.1" # End of file scope inline assembly .globl foo .p2align 4, 0x90 .type foo, at function foo: # @foo .cfistartproc # BB#0: # %entry pushq %rbp .Ltmp0: .cfidefcfaoffset 16 .Ltmp1: .cfioffset %rbp, -16 movq %rsp, %rbp .Ltmp2: .cfidefcfaregister %rbp movl $.L.cst, %edi movl $.L.cst.1, %esi movl $4, %edx movl $func.2210, %ecx xorl %eax, %eax callq printf popq %rbp retq .Lfuncend0: .size foo, .Lfuncend0-foo .cfiendproc .globl main .p2align 4, 0x90 .type main, at function main: # @main .cfistartproc # BB#0: # %entry pushq %rbp .Ltmp3: .cfidefcfaoffset 16 .Ltmp4: .cfioffset %rbp, -16 movq %rsp, %rbp .Ltmp5: .cfidefcfaregister %rbp subq $32, %rsp movl %edi, -8(%rbp) movq %rsi, -16(%rbp) movl $.L.cst.3, %edi movl $.L.cst.2, %esi movl $1, %edx xorl %eax, %eax callq printf movl $0, -4(%rbp) movl -4(%rbp), %eax addq $32, %rsp popq %rbp retq .Lfuncend1: .size main, .Lfuncend1-main .cfiendproc .type func.2210, at object # @func.2210 .section .rodata,"a", at progbits func.2210: .asciz "foo" .size func.2210, 4 .type .L.cst, at object # @.cst .p2align 3 .L.cst: .asciz "DEBUG: %s, line %d: %s\n" .size .L.cst, 24 .type .L.cst.1, at object # @.cst.1 .p2align 3 .L.cst.1: .asciz "test/hello.c" .size .L.cst.1, 13 .type .L.cst.2, at object # @.cst.2 .p2align 3 .L.cst.2: .asciz "Leslie Zhai" .size .L.cst.2, 12 .type .L.cst.3, at object # @.cst.3 .p2align 3 .L.cst.3: .asciz "%s: Hello World %d\n" .size .L.cst.3, 20 .section ".note.GNU-stack","", at progbits $ clang hello.s.s $ ./a.out Leslie Zhai: Hello World 1 WIP: * fix issues https://github.com/xiangzhai/dragonegg/issues * gengtype not support macro https://gcc.gnu.org/ml/gcc/2017-07/msg00045.html -- Regards, Leslie Zhai - a LLVM developer https://reviews.llvm.org/p/xiangzhai/


LLVM Developers mailing list llvm-dev at lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list