This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Remove unnecessary llvm.mlir.cast in AsyncToLLVM lowering.
ClosedPublic

Authored by csigg on Jan 11 2021, 4:25 AM.

Diff Detail

Event Timeline

csigg created this revision.Jan 11 2021, 4:25 AM
csigg requested review of this revision.Jan 11 2021, 4:25 AM

Is it always unnecessary or is there a possibility that it still might be (e.g., async pointer)?

csigg retitled this revision from Remove unnecessary llvm.mlir.cast in AsyncToLLVM lowering. to [mlir] Remove unnecessary llvm.mlir.cast in AsyncToLLVM lowering..Jan 11 2021, 4:44 AM
csigg added a comment.Jan 11 2021, 4:53 AM

Is it always unnecessary or is there a possibility that it still might be (e.g., async pointer)?

AsyncToLLVM lowering only supports std and llvm types. If the former is lowered to llvm but one of the uses expects a std type, the llvm type converter will already materialize an llvm.mlir.cast if needed.

But a manually created instance can be in the way if the async value type is already an llvm type, because llvm.mlir.cast doesn't currently have a folder that would remove a cast between equal types.

Please take my explanation with a grain of salt, my understanding is limited...

ftynse accepted this revision.Jan 11 2021, 5:12 AM
This revision is now accepted and ready to land.Jan 11 2021, 5:12 AM