Skip to content

Unimplemented @llvm.bitreverse.i1 intrinsic #871

@zero9178

Description

@zero9178

Given the following C code:

#include <stdint.h>
uint32_t test20(uint8_t var0) { return var0 & 1 | var0 & 1; }

LLVM for some reason (?) decides to compile it to:

; Function Attrs: nounwind uwtable
define dso_local i32 @test20(i8 noundef zeroext %var0) #0 {
entry:
  %0 = and i8 %var0, 1
  %trunc = icmp ne i8 %0, 0
  %rev = call i1 @llvm.bitreverse.i1(i1 %trunc)
  %or = zext i1 %rev to i32
  ret i32 %or
}

The intrinsic (which I think should be a noop?) is unimplemented and therefore fails the MLIR import

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfuzzer-foundBugs found using an automated fuzzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions