Skip to content

Feature request: pattern match for rotl / rotr #156322

@msalat

Description

@msalat

It would be nice if

#define ROTL(a,b) (((a) << (b)) | ((a) >> (32 - (b))))

could be translated to

__builtin_rotateleft(...)

emscripten (emcc, →wasm2wat | grep -i rot) did not do this automatically using Ubuntu 24.04 x86_64 neither Raspberry Pi OS (Debian bookworm arm64).

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions