Resolves #99114. Tasks completed: - Implement `faceforward` in `hlsl_intrinsics.h`/`hlsl_intrinsic_helpers.h` - Implement `faceforward` SPIR-V target builtin in `clang/include/clang/Basic/BuiltinsSPIRV.td` - Add a SPIR-V fast path in `hlsl_intrinsic_helpers.h` - Add sema checks for `faceforward` to `CheckSPIRVBuiltinFunctionCall` in `clang/lib/Sema/SemaSPIRV.cpp` - Add codegen for SPIR-V `faceforward` builtin to `EmitSPIRVBuiltinExpr` in `SPIR.cpp` - Add HLSL codegen tests to `clang/test/CodeGenHLSL/builtins/faceforward.hlsl` - Add SPIRV builtin codegen tests to `clang/test/CodeGenSPIRV/Builtins/faceforward.c` - Add sema tests to `clang/test/SemaHLSL/BuiltIns/faceforward-errors.hlsl` - Add spirv sema tests to `clang/test/SemaSPIRV/BuiltIns/faceforward-errors.c` - Create the `int_spv_faceforward` intrinsic in `IntrinsicsSPIRV.td` - In `SPIRVInstructionSelector.cpp` create the `faceforward` lowering and map it to `int_spv_faceforward` in `SPIRVInstructionSelector::selectIntrinsic` - Create SPIR-V backend test case in `llvm/test/CodeGen/SPIRV/hlsl-intrinsics/faceforward.ll` Incomplete tasks: - Create SPIR-V backend test case in `llvm/test/CodeGen/SPIRV/opencl/faceforward.ll` - Not applicable because the OpenCL SPIR-V extended instruction set does not include a `faceforward` function Follow-up tasks: - Implement pattern matching for `faceforward` in `SPIRVCombine.td` and `SPIRVPreLegalizerCombiner.cpp` - In `faceforward.ll`, change `--target-env spv1.4` to `vulkan1.3` and update the test accordingly once [#136344](https://github.com/llvm/llvm-project/issues/136344) has been resolved
C language Family Front-end
Welcome to Clang.
This is a compiler front-end for the C family of languages (C, C++ and Objective-C) which is built as part of the LLVM compiler infrastructure project.
Unlike many other compiler frontends, Clang is useful for a number of things beyond just compiling code: we intend for Clang to be host to a number of different source-level tools. One example of this is the Clang Static Analyzer.
If you're interested in more (including how to build Clang) it is best to read the relevant websites. Here are some pointers:
-
Information on Clang: http://clang.llvm.org/
-
Building and using Clang: http://clang.llvm.org/get_started.html
-
Clang Static Analyzer: http://clang-analyzer.llvm.org/
-
Information on the LLVM project: http://llvm.org/
-
If you have questions or comments about Clang, a great place to discuss them is on the Clang forums:
-
If you find a bug in Clang, please file it in the LLVM bug tracker: