[PATCH] D24688: Introduce "hosted" module flag.
dexonsmith requested changes to this revision. dexonsmith added a comment. This revision now requires changes to proceed. Herald added subscribers: kerbowa, steven_wu, atanasyan, zzheng, MaskRay, fedor.sergeev, hiraditya, jvesely, sdardis, emaste. Herald added a reviewer: espindola. Herald added a project: LLVM. You may have abandoned this, but marking as needing changes to get this off my queue. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D24688/new/ https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
mehdi_amini added a comment. Thanks, I'll investigate function attributes then! https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
pcc added a comment. In https://reviews.llvm.org/D24688#638836, @mehdi_amini wrote: > In https://reviews.llvm.org/D24688#638835, @pcc wrote: > > > Didn't we figure out in the end that this could be a function attribute > > instead? > > > We did? You wrote in PR30403: "I had a brief look at what it would take to > have a per-function TLI, and I'm not convinced that it would be worth the > effort." That was before I figured out (see http://lists.llvm.org/pipermail/llvm-dev/2016-September/105035.html) that it would not be sound to have mixed freestanding/hosted mean hosted. Specifically: > Here's one > scenario where we may break: suppose I LTO-link an implementation of memset > compiled with -ffreestanding with a program compiled with -fhosted. With > the proposed rule, the loop idiom recognizer may transform the body of the > memset function into a self-call. You later wrote that we should try not to default to freestanding: http://lists.llvm.org/pipermail/llvm-dev/2016-September/105083.html And I think I agree with that. To me that all makes it more reasonable to pursue a per-function approach. Later on (I don't think it happened on the mailing list or the bug, maybe on IRC) we had another look at GlobalOpt (referenced in PR30403 comment 6) and figured out that we can in fact find a function context. https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
hfinkel added a comment. In https://reviews.llvm.org/D24688#639158, @jyknight wrote: > Since this requires everyone generating llvm IR to add this module attribute > for optimal codegen, it should be documented in release notes and the > LangRef, I think. And, for something like this, here: http://llvm.org/docs/Frontend/PerformanceTips.html > I mean: it's unfortunate that it's needed at all, but at the very least it > should be possible for people to find out about it. https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
mehdi_amini added a comment. In https://reviews.llvm.org/D24688#639158, @jyknight wrote: > Since this requires everyone generating llvm IR to add this module attribute > for optimal codegen, Not sure yet how it'll end up, I'll revamp this. See also: http://lists.llvm.org/pipermail/cfe-dev/2017-January/052114.html > it should be documented in release notes and the LangRef, I think. Thanks, I'll try not to forget. https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
jyknight added a comment. Since this requires everyone generating llvm IR to add this module attribute for optimal codegen, it should be documented in release notes and the LangRef, I think. I mean: it's unfortunate that it's needed at all, but at the very least it should be possible for people to find out about it. https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
mehdi_amini added a comment. In https://reviews.llvm.org/D24688#638835, @pcc wrote: > Didn't we figure out in the end that this could be a function attribute > instead? We did? You wrote in PR30403: "I had a brief look at what it would take to have a per-function TLI, and I'm not convinced that it would be worth the effort." https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
pcc added a comment. Didn't we figure out in the end that this could be a function attribute instead? https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
mehdi_amini updated this revision to Diff 83510. mehdi_amini added a comment. Rebase https://reviews.llvm.org/D24688 Files: clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/test/CodeGen/nobuiltin.c clang/test/CodeGenCUDA/flush-denormals.cu clang/test/CodeGenCXX/strict-vtable-pointers.cpp lld/test/ELF/lto/undefined-puts.ll llvm/include/llvm/Analysis/TargetLibraryInfo.h llvm/lib/Analysis/TargetLibraryInfo.cpp llvm/lib/LTO/LTOBackend.cpp llvm/lib/LTO/LTOCodeGenerator.cpp llvm/lib/LTO/ThinLTOCodeGenerator.cpp llvm/lib/LTO/UpdateCompilerUsed.cpp llvm/test/Analysis/GlobalsModRef/indirect-global.ll llvm/test/Analysis/GlobalsModRef/memset-escape.ll llvm/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll llvm/test/CodeGen/AArch64/arm64-fcopysign.ll llvm/test/CodeGen/AArch64/arm64-rounding.ll llvm/test/CodeGen/AArch64/arm64-sincos.ll llvm/test/CodeGen/AArch64/floatdp_1source.ll llvm/test/CodeGen/AArch64/round-conv.ll llvm/test/CodeGen/AMDGPU/complex-folding.ll llvm/test/CodeGen/AMDGPU/fabs.f64.ll llvm/test/CodeGen/AMDGPU/fabs.ll llvm/test/CodeGen/AMDGPU/floor.ll llvm/test/CodeGen/AMDGPU/fneg-fabs.f64.ll llvm/test/CodeGen/AMDGPU/fneg-fabs.ll llvm/test/CodeGen/AMDGPU/llvm.SI.fs.interp.ll llvm/test/CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll llvm/test/CodeGen/AMDGPU/schedule-if-2.ll llvm/test/CodeGen/ARM/apcs-vfp.ll llvm/test/CodeGen/ARM/arm32-round-conv.ll llvm/test/CodeGen/ARM/arm32-rounding.ll llvm/test/CodeGen/ARM/fabs-to-bfc.ll llvm/test/CodeGen/ARM/fabss.ll llvm/test/CodeGen/ARM/fcopysign.ll llvm/test/CodeGen/ARM/floorf.ll llvm/test/CodeGen/ARM/fparith.ll llvm/test/CodeGen/ARM/ifcvt10.ll llvm/test/CodeGen/ARM/sincos.ll llvm/test/CodeGen/ARM/v7k-libcalls.ll llvm/test/CodeGen/ARM/v7k-sincos.ll llvm/test/CodeGen/ARM/vfp.ll llvm/test/CodeGen/Hexagon/fminmax.ll llvm/test/CodeGen/Hexagon/opt-fabs.ll llvm/test/CodeGen/Mips/f16abs.ll llvm/test/CodeGen/Mips/fabs.ll llvm/test/CodeGen/Mips/fcopysign-f32-f64.ll llvm/test/CodeGen/Mips/fcopysign.ll llvm/test/CodeGen/Mips/llvm-ir/sqrt.ll llvm/test/CodeGen/Mips/mips64-f128.ll llvm/test/CodeGen/Mips/optimize-fp-math.ll llvm/test/CodeGen/PowerPC/copysignl.ll llvm/test/CodeGen/PowerPC/fabs.ll llvm/test/CodeGen/PowerPC/fcpsgn.ll llvm/test/CodeGen/PowerPC/fnabs.ll llvm/test/CodeGen/PowerPC/rounding-ops.ll llvm/test/CodeGen/PowerPC/vsx-elementary-arith.ll llvm/test/CodeGen/SPARC/64abi.ll llvm/test/CodeGen/SystemZ/fp-copysign-01.ll llvm/test/CodeGen/SystemZ/fp-sincos-01.ll llvm/test/CodeGen/SystemZ/fp-sqrt-01.ll llvm/test/CodeGen/SystemZ/fp-sqrt-02.ll llvm/test/CodeGen/SystemZ/memchr-01.ll llvm/test/CodeGen/SystemZ/memchr-02.ll llvm/test/CodeGen/SystemZ/memcmp-01.ll llvm/test/CodeGen/SystemZ/memcmp-02.ll llvm/test/CodeGen/SystemZ/strcmp-01.ll llvm/test/CodeGen/SystemZ/strcmp-02.ll llvm/test/CodeGen/SystemZ/strcpy-01.ll llvm/test/CodeGen/SystemZ/strlen-01.ll llvm/test/CodeGen/SystemZ/strlen-02.ll llvm/test/CodeGen/X86/avx512-arith.ll llvm/test/CodeGen/X86/fabs.ll llvm/test/CodeGen/X86/fmaxnum.ll llvm/test/CodeGen/X86/fminnum.ll llvm/test/CodeGen/X86/fnabs.ll llvm/test/CodeGen/X86/fp-in-intregs.ll llvm/test/CodeGen/X86/fp128-cast.ll llvm/test/CodeGen/X86/fp128-i128.ll llvm/test/CodeGen/X86/memcmp.ll llvm/test/CodeGen/X86/mempcpy.ll llvm/test/CodeGen/X86/pr13577.ll llvm/test/CodeGen/X86/pr2656.ll llvm/test/CodeGen/X86/pr26625.ll llvm/test/CodeGen/X86/rounding-ops.ll llvm/test/CodeGen/X86/sincos-opt.ll llvm/test/CodeGen/X86/sincos.ll llvm/test/CodeGen/X86/stack-align.ll llvm/test/Instrumentation/AddressSanitizer/str-nobuiltin.ll llvm/test/Instrumentation/BoundsChecking/simple.ll llvm/test/Instrumentation/EfficiencySanitizer/str-nobuiltin.ll llvm/test/Instrumentation/MemorySanitizer/str-nobuiltin.ll llvm/test/Instrumentation/ThreadSanitizer/str-nobuiltin.ll llvm/test/LTO/X86/runtime-library.ll llvm/test/LTO/X86/triple-init.ll llvm/test/Transforms/ConstProp/calls.ll llvm/test/Transforms/Coroutines/ArgAddr.ll llvm/test/Transforms/Coroutines/ex3.ll llvm/test/Transforms/DeadStoreElimination/2016-07-17-UseAfterFree.ll llvm/test/Transforms/DeadStoreElimination/calloc-store.ll llvm/test/Transforms/DeadStoreElimination/fence.ll llvm/test/Transforms/DeadStoreElimination/free.ll llvm/test/Transforms/DeadStoreElimination/libcalls.ll llvm/test/Transforms/DeadStoreElimination/operand-bundles.ll llvm/test/Transforms/DeadStoreElimination/simple.ll llvm/test/Transforms/GVN/calloc-load-removal.ll llvm/test/Transforms/GVN/malloc-load-removal.ll llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll llvm/test/Transforms/GVN/nonescaping-malloc.ll llvm/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll llvm/test/Transforms/GlobalOpt/MallocSROA-section.ll llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll
Re: [PATCH] D24688: Introduce "hosted" module flag.
pcc added a comment. The word "hosted" takes its meaning from the C/C++ standards. It refers to a build environment where the standard library is guaranteed to be available. Note that we've been rethinking this approach on the mailing list, see http://lists.llvm.org/pipermail/llvm-dev/2016-September/105035.html https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24688: Introduce "hosted" module flag.
tstellarAMD added a comment. What does "hosted mode" mean? https://reviews.llvm.org/D24688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24688: Introduce "hosted" module flag.
pcc created this revision. pcc added reviewers: mehdi_amini, dexonsmith. pcc added subscribers: llvm-commits, cfe-commits. Herald added a reviewer: tstellarAMD. Herald added subscribers: nhaehnle, nemanjai, mehdi_amini, jyknight, qcolombet. This module flag is used to mark modules which were compiled in hosted mode. The TargetLibraryInfoImpl class now uses this module flag to initialize library availability information. Fixes PR30403. https://reviews.llvm.org/D24688 Files: clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/test/CodeGen/nobuiltin.c clang/test/CodeGenCUDA/flush-denormals.cu clang/test/CodeGenCXX/strict-vtable-pointers.cpp lld/ELF/LTO.cpp lld/test/ELF/lto/undefined-puts.ll llvm/include/llvm/Analysis/TargetLibraryInfo.h llvm/lib/Analysis/TargetLibraryInfo.cpp llvm/lib/LTO/LTOBackend.cpp llvm/lib/LTO/LTOCodeGenerator.cpp llvm/lib/LTO/ThinLTOCodeGenerator.cpp llvm/lib/LTO/UpdateCompilerUsed.cpp llvm/test/Analysis/GlobalsModRef/indirect-global.ll llvm/test/Analysis/GlobalsModRef/memset-escape.ll llvm/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll llvm/test/CodeGen/AArch64/arm64-fcopysign.ll llvm/test/CodeGen/AArch64/arm64-rounding.ll llvm/test/CodeGen/AArch64/arm64-sincos.ll llvm/test/CodeGen/AArch64/floatdp_1source.ll llvm/test/CodeGen/AArch64/round-conv.ll llvm/test/CodeGen/AMDGPU/complex-folding.ll llvm/test/CodeGen/AMDGPU/fabs.f64.ll llvm/test/CodeGen/AMDGPU/fabs.ll llvm/test/CodeGen/AMDGPU/floor.ll llvm/test/CodeGen/AMDGPU/fneg-fabs.f64.ll llvm/test/CodeGen/AMDGPU/fneg-fabs.ll llvm/test/CodeGen/AMDGPU/llvm.SI.fs.interp.ll llvm/test/CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll llvm/test/CodeGen/AMDGPU/schedule-if-2.ll llvm/test/CodeGen/AMDGPU/sgpr-copy.ll llvm/test/CodeGen/AMDGPU/si-sgpr-spill.ll llvm/test/CodeGen/ARM/apcs-vfp.ll llvm/test/CodeGen/ARM/arm32-round-conv.ll llvm/test/CodeGen/ARM/arm32-rounding.ll llvm/test/CodeGen/ARM/fabs-to-bfc.ll llvm/test/CodeGen/ARM/fabss.ll llvm/test/CodeGen/ARM/fcopysign.ll llvm/test/CodeGen/ARM/floorf.ll llvm/test/CodeGen/ARM/fparith.ll llvm/test/CodeGen/ARM/ifcvt10.ll llvm/test/CodeGen/ARM/sincos.ll llvm/test/CodeGen/ARM/v7k-libcalls.ll llvm/test/CodeGen/ARM/v7k-sincos.ll llvm/test/CodeGen/ARM/vfp.ll llvm/test/CodeGen/Hexagon/fminmax.ll llvm/test/CodeGen/Hexagon/opt-fabs.ll llvm/test/CodeGen/Mips/f16abs.ll llvm/test/CodeGen/Mips/fabs.ll llvm/test/CodeGen/Mips/fcopysign-f32-f64.ll llvm/test/CodeGen/Mips/fcopysign.ll llvm/test/CodeGen/Mips/llvm-ir/sqrt.ll llvm/test/CodeGen/Mips/mips64-f128.ll llvm/test/CodeGen/Mips/optimize-fp-math.ll llvm/test/CodeGen/PowerPC/copysignl.ll llvm/test/CodeGen/PowerPC/fabs.ll llvm/test/CodeGen/PowerPC/fcpsgn.ll llvm/test/CodeGen/PowerPC/fnabs.ll llvm/test/CodeGen/PowerPC/rounding-ops.ll llvm/test/CodeGen/PowerPC/vsx-elementary-arith.ll llvm/test/CodeGen/SPARC/64abi.ll llvm/test/CodeGen/SystemZ/fp-copysign-01.ll llvm/test/CodeGen/SystemZ/fp-sincos-01.ll llvm/test/CodeGen/SystemZ/fp-sqrt-01.ll llvm/test/CodeGen/SystemZ/fp-sqrt-02.ll llvm/test/CodeGen/SystemZ/memchr-01.ll llvm/test/CodeGen/SystemZ/memchr-02.ll llvm/test/CodeGen/SystemZ/memcmp-01.ll llvm/test/CodeGen/SystemZ/memcmp-02.ll llvm/test/CodeGen/SystemZ/strcmp-01.ll llvm/test/CodeGen/SystemZ/strcmp-02.ll llvm/test/CodeGen/SystemZ/strcpy-01.ll llvm/test/CodeGen/SystemZ/strlen-01.ll llvm/test/CodeGen/SystemZ/strlen-02.ll llvm/test/CodeGen/X86/avx-arith.ll llvm/test/CodeGen/X86/avx512-arith.ll llvm/test/CodeGen/X86/copysign-constant-magnitude.ll llvm/test/CodeGen/X86/fabs.ll llvm/test/CodeGen/X86/fmaxnum.ll llvm/test/CodeGen/X86/fminnum.ll llvm/test/CodeGen/X86/fnabs.ll llvm/test/CodeGen/X86/fp-in-intregs.ll llvm/test/CodeGen/X86/fp128-cast.ll llvm/test/CodeGen/X86/fp128-i128.ll llvm/test/CodeGen/X86/memcmp.ll llvm/test/CodeGen/X86/mempcpy.ll llvm/test/CodeGen/X86/negative-sin.ll llvm/test/CodeGen/X86/pr13577.ll llvm/test/CodeGen/X86/pr2656.ll llvm/test/CodeGen/X86/pr26625.ll llvm/test/CodeGen/X86/rounding-ops.ll llvm/test/CodeGen/X86/sincos-opt.ll llvm/test/CodeGen/X86/sincos.ll llvm/test/CodeGen/X86/sqrt-fastmath.ll llvm/test/CodeGen/X86/stack-align.ll llvm/test/Instrumentation/AddressSanitizer/str-nobuiltin.ll llvm/test/Instrumentation/BoundsChecking/simple.ll llvm/test/Instrumentation/EfficiencySanitizer/str-nobuiltin.ll llvm/test/Instrumentation/MemorySanitizer/str-nobuiltin.ll llvm/test/Instrumentation/ThreadSanitizer/str-nobuiltin.ll llvm/test/LTO/X86/runtime-library.ll llvm/test/LTO/X86/triple-init.ll llvm/test/Transforms/ConstProp/calls.ll llvm/test/Transforms/Coroutines/ArgAddr.ll llvm/test/Transforms/Coroutines/ex3.ll llvm/test/Transforms/DeadStoreElimination/2016-07-17-UseAfterFree.ll llvm/test/Transforms/DeadStoreElimination/calloc-store.ll llvm/test/Transforms/DeadStoreElimination/fence.ll