This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Conversion/GPUCommon] Fix bug in conversion of `math` ops
ClosedPublic

Authored by christopherbate on Jun 30 2023, 3:11 PM.

Details

Summary

The common GPU operation transformation that lowers math operations
to function calls in the gpu-to-nvvm and gpu-to-rocdl passes handles
vector types by applying the function to each scalar and returning a
new vector. However, there was a typo that results in incorrectly
accumulating the result vector, and the rewrite returns an llvm.mlir.undef
result instead of the correct vector. A patch is added and tests are
strengthened.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript
christopherbate requested review of this revision.Jun 30 2023, 3:11 PM
ThomasRaoux accepted this revision.Jun 30 2023, 3:22 PM

Good catch!

This revision is now accepted and ready to land.Jun 30 2023, 3:22 PM