This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Add inalloca attribute to alloca op.
ClosedPublic

Authored by Moxinilian on Mar 7 2023, 2:32 AM.

Details

Summary

This revision adds the inalloca attribute to the alloca operation in the LLVMIR dialect.
It also adds tests for import and export.

Diff Detail

Event Timeline

Moxinilian created this revision.Mar 7 2023, 2:32 AM
Herald added a project: Restricted Project. · View Herald Transcript
Moxinilian requested review of this revision.Mar 7 2023, 2:32 AM
gysit added inline comments.Mar 7 2023, 3:24 AM
mlir/test/Dialect/LLVMIR/roundtrip.mlir
329–332

nit: you could drop the new test cases and add the inalloca attribute to the last test case right before the newly introduced code.

mlir/test/Target/LLVMIR/Import/instructions.ll
349

nit: having one test case with inalloca should be sufficient.

mlir/test/Target/LLVMIR/llvmir.mlir
1359

same here except you are testing something different?

Moxinilian added inline comments.Mar 7 2023, 3:40 AM
mlir/test/Target/LLVMIR/llvmir.mlir
1359

I'm testing that the attribute dictionary still works with inalloca, but yeah I'll just drop that.

Moxinilian updated this revision to Diff 503017.Mar 7 2023, 6:11 AM

Addressed comments.

gysit accepted this revision.Mar 7 2023, 6:14 AM

LGTM!

This revision is now accepted and ready to land.Mar 7 2023, 6:14 AM
Moxinilian updated this revision to Diff 503383.Mar 8 2023, 8:10 AM

Improve code style.

Moxinilian updated this revision to Diff 503389.Mar 8 2023, 8:14 AM

Fix silly forgotten argument.

This revision was automatically updated to reflect the committed changes.