[clang] [Clang][CIR] Add lowering for fp16 rounding intrinsics (PR #195584)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 3 22:36:41 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 89144 tests passed
* 828 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CodeGen/AArch64/neon/fullfp16.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +fullfp16 -disable-O0-optnone           -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -S -passes=mem2reg             | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c --check-prefixes=ALL,LLVM
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +fullfp16 -disable-O0-optnone -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -S -passes=mem2reg
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c --check-prefixes=ALL,LLVM
# note: command had no output on stdout or stderr
# RUN: at line 4
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +fullfp16 -disable-O0-optnone -fclangir -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -S -passes=mem2reg,simplifycfg | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c --check-prefixes=ALL,LLVM
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +fullfp16 -disable-O0-optnone -fclangir -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c
# .---command stderr------------
# | clang: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/Instructions.cpp:3054: static CastInst *llvm::CastInst::Create(Instruction::CastOps, Value *, Type *, const Twine &, InsertPosition): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
# | Stack dump:
# | 0.	Program arguments: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +fullfp16 -disable-O0-optnone -fclangir -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c
# | 1.	<eof> parser at end of file
# |  #0 0x000000000a36c578 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
# |  #1 0x000000000a3694e1 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
# |  #2 0x000000000a36d391 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
# |  #3 0x000000000a36d1e8 __find_if<const int *, __gnu_cxx::__ops::_Iter_equals_val<const int> > /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algobase.h:2072:8
# |  #4 0x000000000a36d1e8 __find_if<const int *, __gnu_cxx::__ops::_Iter_equals_val<const int> > /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algobase.h:2117:14
# |  #5 0x000000000a36d1e8 find<const int *, int> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algo.h:3897:14
# |  #6 0x000000000a36d1e8 is_contained<const int (&)[10], int> /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1952:12
# |  #7 0x000000000a36d1e8 SignalHandlerTerminate(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:464:7
# |  #8 0x0000797fbb496330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
# |  #9 0x0000797fbb4efb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
# | #10 0x0000797fbb49627e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
# | #11 0x0000797fbb4798ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
# | #12 0x0000797fbb47981b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
# | #13 0x0000797fbb48c517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
# | #14 0x0000000009cb69b3 llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::InsertPosition) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/Instructions.cpp:3074:5
# | #15 0x00000000075b0a95 doit /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Casting.h:109:12
# | #16 0x00000000075b0a95 doit /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Casting.h:137:12
# | #17 0x00000000075b0a95 doit /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Casting.h:127:12
# | #18 0x00000000075b0a95 isPossible /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Casting.h:255:12
# | #19 0x00000000075b0a95 isPossible /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Casting.h:509:12
# | #20 0x00000000075b0a95 isa<llvm::FPMathOperator, llvm::Instruction *> /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Casting.h:548:11
# | #21 0x00000000075b0a95 llvm::IRBuilderBase::CreateCast(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::MDNode*, llvm::FMFSource) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2277:9
# | #22 0x000000000c487c02 CreateBitCast /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2237:12
# | #23 0x000000000c487c02 convertOperationImpl(mlir::Operation&, llvm::IRBuilderBase&, mlir::LLVM::ModuleTranslation&) /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMConversions.inc:90:51
# | #24 0x000000000c7fd79b mlir::LLVM::ModuleTranslation::convertOperationImpl(mlir::Operation&, llvm::IRBuilderBase&, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:1023:7
# | #25 0x000000000c7fdff5 mlir::LLVM::ModuleTranslation::convertBlockImpl(mlir::Block&, bool, llvm::IRBuilderBase&, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:1073:9
# | #26 0x000000000c802e65 mlir::LLVM::ModuleTranslation::convertOneFunction(mlir::LLVM::LLVMFuncOp) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:1619:16
# | #27 0x000000000c806803 mlir::LLVM::ModuleTranslation::convertFunctions() /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:2037:9
# | #28 0x000000000c80a03a mlir::translateModuleToLLVMIR(mlir::Operation*, llvm::LLVMContext&, llvm::StringRef, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:2546:7
# | #29 0x000000000b68c0f8 operator bool /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:487:22
# | #30 0x000000000b68c0f8 cir::direct::lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp, llvm::LLVMContext&, llvm::StringRef) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp:5107:8
# | #31 0x000000000b5b49df cir::CIRGenConsumer::HandleTranslationUnit(clang::ASTContext&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CIR/FrontendAction/CIRGenAction.cpp:165:63
# | #32 0x000000000e1ec0a9 __normal_iterator /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_iterator.h:1077:20
# | #33 0x000000000e1ec0a9 begin /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:874:16
# | #34 0x000000000e1ec0a9 finalize<std::vector<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> >, std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> > > > > /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Sema/TemplateInstCallback.h:54:16
# | #35 0x000000000e1ec0a9 clang::ParseAST(clang::Sema&, bool, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Parse/ParseAST.cpp:190:3
# | #36 0x000000000b231db6 clang::FrontendAction::Execute() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1346:10
# | #37 0x000000000b190efa getPtr /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Error.h:278:42
# | #38 0x000000000b190efa operator bool /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Error.h:241:16
# | #39 0x000000000b190efa clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1013:23
# | #40 0x000000000b32a9f4 get /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:1666:16
# | #41 0x000000000b32a9f4 _M_get /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:1363:66
# | #42 0x000000000b32a9f4 operator-> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:1357:9
# | #43 0x000000000b32a9f4 getFrontendOpts /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Frontend/CompilerInstance.h:314:12
# | #44 0x000000000b32a9f4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:319:14
# | #45 0x0000000007492a80 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/tools/driver/cc1_main.cpp:296:13
# | #46 0x000000000748e875 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/tools/driver/driver.cpp:229:12
# | #47 0x000000000748d840 clang_main(int, char**, llvm::ToolContext const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/tools/driver/driver.cpp:277:12
# | #48 0x000000000749ed9d main /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/driver/clang-driver.cpp:17:10
# | #49 0x0000797fbb47b1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
# | #50 0x0000797fbb47b28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
# | #51 0x000000000748c1e5 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang+0x748c1e5)
# `-----------------------------
# error: command failed with exit status: -6
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -S -passes=mem2reg,simplifycfg
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c --check-prefixes=ALL,LLVM
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c:41:15: error: ALL-LABEL: expected string not found in input
# | // ALL-LABEL: test_vrndh_f16
# |               ^
# | <stdin>:1:1: note: scanning from here
# | ; ModuleID = '<stdin>'
# | ^
# | <stdin>:1:14: note: possible intended match here
# | ; ModuleID = '<stdin>'
# |              ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/AArch64/neon/fullfp16.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: ; ModuleID = '<stdin>' 
# | label:41'0     X~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# | label:41'1                  ?          possible intended match
# |             2: source_filename = "<stdin>" 
# | label:41'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/195584


More information about the cfe-commits mailing list