[clang] 23058f9 - [OPENMP]Do not use RTTI by default for NVPTX devices.

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 15 14:26:24 PST 2020


Alexey,

This breaks compilation of our cuda code which happens to transitively
include protobuf headers.
Can you, please, revert it for now until we figure out how RTTI should be
handled?

--Artem

On Tue, Jan 14, 2020 at 3:15 PM Alexey Bataev via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

>
> Author: Alexey Bataev
> Date: 2020-01-14T18:12:06-05:00
> New Revision: 23058f9dd4d7e18239fd63b6da52549514b45fda
>
> URL:
> https://github.com/llvm/llvm-project/commit/23058f9dd4d7e18239fd63b6da52549514b45fda
> DIFF:
> https://github.com/llvm/llvm-project/commit/23058f9dd4d7e18239fd63b6da52549514b45fda.diff
>
> LOG: [OPENMP]Do not use RTTI by default for NVPTX devices.
>
> NVPTX does not support RTTI, so disable it by default.
>
> Added:
>     clang/test/Driver/openmp-offload-gpu.cpp
>
> Modified:
>     clang/lib/Driver/ToolChain.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/clang/lib/Driver/ToolChain.cpp
> b/clang/lib/Driver/ToolChain.cpp
> index cab97b1a601a..3ebbd30195b3 100644
> --- a/clang/lib/Driver/ToolChain.cpp
> +++ b/clang/lib/Driver/ToolChain.cpp
> @@ -68,7 +68,8 @@ static ToolChain::RTTIMode CalculateRTTIMode(const
> ArgList &Args,
>    }
>
>    // -frtti is default, except for the PS4 CPU.
> -  return (Triple.isPS4CPU()) ? ToolChain::RM_Disabled :
> ToolChain::RM_Enabled;
> +  return (Triple.isPS4CPU() || Triple.isNVPTX()) ? ToolChain::RM_Disabled
> +                                                 : ToolChain::RM_Enabled;
>  }
>
>  ToolChain::ToolChain(const Driver &D, const llvm::Triple &T,
>
> diff  --git a/clang/test/Driver/openmp-offload-gpu.cpp
> b/clang/test/Driver/openmp-offload-gpu.cpp
> new file mode 100644
> index 000000000000..9da7308506ae
> --- /dev/null
> +++ b/clang/test/Driver/openmp-offload-gpu.cpp
> @@ -0,0 +1,20 @@
> +///
> +/// Perform several driver tests for OpenMP offloading
> +///
> +
> +// REQUIRES: clang-driver
> +// REQUIRES: x86-registered-target
> +// REQUIRES: powerpc-registered-target
> +// REQUIRES: nvptx-registered-target
> +
> +///
> ###########################################################################
> +
> +/// PTXAS is passed -c flag by default when offloading to an NVIDIA
> device using OpenMP
> +/// Check that the flag is passed when -fopenmp-relocatable-target is
> used.
> +// RUN:   %clangxx -### -fopenmp=libomp
> -fopenmp-targets=nvptx64-nvidia-cuda \
> +// RUN:          -save-temps -no-canonical-prefixes %s -x c++ -c 2>&1 \
> +// RUN:   | FileCheck -check-prefix=CHK-RTTI %s
> +
> +// CHK-RTTI: clang{{.*}}" "-triple" "nvptx64-nvidia-cuda"
> +// CHK-RTTI-SAME: "-fno-rtti"
> +
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>


-- 
--Artem Belevich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200115/dff974b1/attachment.html>


More information about the cfe-commits mailing list