This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][LLVMDialect] Added bitreverse and ctpop intrinsics
ClosedPublic

Authored by georgemitenkov on Jun 22 2020, 12:42 AM.

Details

Summary

Introduced llvm.intr.bitreverse and llvm.intr.ctpop LLVM bit intrinsics to LLVM dialect. These intrinsics help with SPIR-V to LLVM conversion, allowing a direct mapping from spv.BitReverse and spv.BitCount respectively. Tests are added to roundtrip.mlir and llvm-intrinsics.mlir.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2020, 12:42 AM
georgemitenkov edited the summary of this revision. (Show Details)Jun 22 2020, 12:43 AM
ftynse accepted this revision.Jun 22 2020, 12:46 AM
ftynse added inline comments.
mlir/test/Dialect/LLVMIR/roundtrip.mlir
106

Let's not pattern-match against SSA value name - llvm.intr.bitreverse"(%{{.*}}) - I know this file needs to be updated in that direction, but at least let's have new code clean.

This revision is now accepted and ready to land.Jun 22 2020, 12:46 AM
georgemitenkov marked an inline comment as done.
  • [MLIR][LLVMDialect] Removed pattern match on args

Removed pattern-match against SSA value name when testing bitreverse and ctpop intrinsivs in roundtrip.mlir.

This revision was automatically updated to reflect the committed changes.