This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu] Fix option parsing in `TargetOptions`
ClosedPublic

Authored by fmorac on Sep 4 2023, 10:19 AM.

Details

Summary

TargetOptions includes a field for passing additional command line options to
the GPU compilation process. This field is typically used during the 'gpu-module-to-binary`
pass:

--gpu-module-to-binary=opts="-v -c"

The problem is that tokenizeCmdOptions receives the quoted string, which produces an
incorrect tokenization for "-v -c". This patch removes quotes, fixing this issue.

Diff Detail

Event Timeline

fmorac created this revision.Sep 4 2023, 10:19 AM
fmorac published this revision for review.Sep 4 2023, 10:30 AM
bondhugula added inline comments.Sep 4 2023, 12:53 PM
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
2010

opts.size() -> !opts.empty()

2010–2013

Need a code comment.

fmorac updated this revision to Diff 555776.Sep 4 2023, 2:10 PM
fmorac marked 2 inline comments as done.

Addressed comments.

mehdi_amini accepted this revision.Sep 4 2023, 5:43 PM
This revision is now accepted and ready to land.Sep 4 2023, 5:43 PM
This revision was landed with ongoing or failed builds.Sep 4 2023, 5:54 PM
This revision was automatically updated to reflect the committed changes.