| commit | f9b080cf5f433fa00678d5cc90b5ef76eb43aa8e | [log] [tgz] |
|---|---|---|
| author | ZhaoQi <zhaoqi01@loongson.cn> | Mon Sep 22 18:05:16 2025 +0800 |
| committer | GitHub <noreply@github.com> | Mon Sep 22 18:05:16 2025 +0800 |
| tree | 7cf11881de33f9b706d388130129eb9902bf45aa | |
| parent | d46998b1dd1a2db10f4372a0ac8eced9c5b5a073 [diff] |
[LoongArch] Custom legalizing ConstantFP to avoid float loads (#158050) This commit custom legalize `ConstantFP` using code sequence rather than simpily loading the fp values from constant pool. A new option (`-loongarch-materialize-float-imm=<enum>`) is added to set the maximum number of instructions (including code sequence to generate the value and moving the value to FPR) alllowed to be used when materializing floating-point immediates. The default value of the option is set to `3` on both LA32 and LA64. Which means: - For `f32` on both LA32 and LA64: `2 insts + movgr2fr.w`; (will cover all `f32` values) - For `f64` on LA64: `2 insts + movgr2fr.d`; - For `f64` on LA32: `1 inst + movgr2fr.w + movgr2frh.w`. (same inst latency as using constant pool) The option can be set in range `0,2-6`. (6 behaves same as 5 on LA64.)
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.