[lld] r310526 - Add --icf=none option.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 10 13:06:49 PDT 2017
I like the idea of porting the option to 5.0.
Thanks,
Rafael
Shoaib Meenai via llvm-commits <llvm-commits at lists.llvm.org> writes:
> Any objection to picking this to 5.0? It's a pretty useful option (and a pretty small patch).
>
> On 8/9/17, 2:32 PM, "llvm-commits on behalf of Rui Ueyama via llvm-commits" <llvm-commits-bounces at lists.llvm.org on behalf of llvm-commits at lists.llvm.org> wrote:
>
> Author: ruiu
> Date: Wed Aug 9 14:32:38 2017
> New Revision: 310526
>
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D310526-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=OO3GllO4F5IFKeO52l9l_RNOu-eq90SPbtlXQqJrrUU&s=MIznUoxefxPu3Nr-sHMgISSGAzkU22180ihvOOizlN0&e=
> Log:
> Add --icf=none option.
>
> --icf=none negates --icf=all.
>
> Added:
> lld/trunk/test/ELF/icf-none.s
> Modified:
> lld/trunk/ELF/Driver.cpp
> lld/trunk/ELF/Options.td
>
> Modified: lld/trunk/ELF/Driver.cpp
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_ELF_Driver.cpp-3Frev-3D310526-26r1-3D310525-26r2-3D310526-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=OO3GllO4F5IFKeO52l9l_RNOu-eq90SPbtlXQqJrrUU&s=M9ecubiFg0tDcMnAhdjtMSHLfqyTkmv9vNgQxnDT0Rc&e=
> ==============================================================================
> --- lld/trunk/ELF/Driver.cpp (original)
> +++ lld/trunk/ELF/Driver.cpp Wed Aug 9 14:32:38 2017
> @@ -637,7 +637,7 @@ void LinkerDriver::readConfigs(opt::Inpu
> Config->Fini = Args.getLastArgValue(OPT_fini, "_fini");
> Config->GcSections = getArg(Args, OPT_gc_sections, OPT_no_gc_sections, false);
> Config->GdbIndex = Args.hasArg(OPT_gdb_index);
> - Config->ICF = Args.hasArg(OPT_icf);
> + Config->ICF = getArg(Args, OPT_icf_all, OPT_icf_none, false);
> Config->Init = Args.getLastArgValue(OPT_init, "_init");
> Config->LTOAAPipeline = Args.getLastArgValue(OPT_lto_aa_pipeline);
> Config->LTONewPmPasses = Args.getLastArgValue(OPT_lto_newpm_passes);
>
> Modified: lld/trunk/ELF/Options.td
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_ELF_Options.td-3Frev-3D310526-26r1-3D310525-26r2-3D310526-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=OO3GllO4F5IFKeO52l9l_RNOu-eq90SPbtlXQqJrrUU&s=YN3QpMYih32iGu78hCOaLR1gFju_Ilzo6F59gYXuqzw&e=
> ==============================================================================
> --- lld/trunk/ELF/Options.td (original)
> +++ lld/trunk/ELF/Options.td Wed Aug 9 14:32:38 2017
> @@ -139,7 +139,9 @@ defm hash_style: Eq<"hash-style">,
>
> def help: F<"help">, HelpText<"Print option help">;
>
> -def icf: F<"icf=all">, HelpText<"Enable identical code folding">;
> +def icf_all: F<"icf=all">, HelpText<"Enable identical code folding">;
> +
> +def icf_none: F<"icf=none">, HelpText<"Disable identical code folding">;
>
> defm image_base : Eq<"image-base">, HelpText<"Set the base address">;
>
>
> Added: lld/trunk/test/ELF/icf-none.s
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_test_ELF_icf-2Dnone.s-3Frev-3D310526-26view-3Dauto&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=OO3GllO4F5IFKeO52l9l_RNOu-eq90SPbtlXQqJrrUU&s=hhDreXmsaDgZ7zd9gbrrsrq2Wzb5YTBDNoFOniAXAIU&e=
> ==============================================================================
> --- lld/trunk/test/ELF/icf-none.s (added)
> +++ lld/trunk/test/ELF/icf-none.s Wed Aug 9 14:32:38 2017
> @@ -0,0 +1,22 @@
> +# REQUIRES: x86
> +
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
> +# RUN: ld.lld %t -o %t2 --icf=all --icf=none --verbose | FileCheck %s
> +
> +# CHECK-NOT: selected .text.f1
> +
> +.globl _start, f1, f2
> +_start:
> + ret
> +
> +.section .text.f1, "ax"
> +f1:
> + mov $60, %rax
> + mov $42, %rdi
> + syscall
> +
> +.section .text.f2, "ax"
> +f2:
> + mov $60, %rax
> + mov $42, %rdi
> + syscall
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=OO3GllO4F5IFKeO52l9l_RNOu-eq90SPbtlXQqJrrUU&s=hYTTXY3-rx5gT4r3cQr49M8xB84z7Tk6-zEZoXHEzXE&e=
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list