llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.3k stars 12.11k forks source link

MIPS: Support __builtin_readcyclecounter #106318

Open wzssyqa opened 3 months ago

wzssyqa commented 3 months ago
unsigned long long x() {
        return __builtin_readcyclecounter();
}
./bin/clang --target=mips-linux-gnu -O2 tt.c -S
        addiu   $2, $zero, 0
        jr      $ra
        addiu   $3, $zero, 0
llvmbot commented 3 months ago

@llvm/issue-subscribers-backend-mips

Author: YunQiang Su (wzssyqa)

``` unsigned long long x() { return __builtin_readcyclecounter(); } ``` ``` ./bin/clang --target=mips-linux-gnu -O2 tt.c -S ``` ``` addiu $2, $zero, 0 jr $ra addiu $3, $zero, 0 ```