This is an archive of the discontinued LLVM Phabricator instance.

Add RsqrtOp to LLVM dialect.
AbandonedPublic

Authored by akuegel on Feb 11 2020, 6:33 AM.

Details

Summary

Add a convenience Op Rsqrt which is 1 / sqrt.

Also add the SameOperandsAndResultType trait to the Log Op.

Diff Detail

Unit TestsFailed

Event Timeline

akuegel created this revision.Feb 11 2020, 6:33 AM
akuegel edited the summary of this revision. (Show Details)Feb 11 2020, 6:34 AM
akuegel added reviewers: herhut, pifon2a.
pifon2a accepted this revision.Feb 11 2020, 6:57 AM
This revision is now accepted and ready to land.Feb 11 2020, 6:57 AM

Feel free to remove the changes to log. But with your change it seems even less consistent than before.

This should be cleaned up, though.

mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
755

Hmm, these could all be UnaryIntrinsicsOp, no? Or am I missing something?

Not that you need to clean this up but as you touched this one, why not the others?

ftynse requested changes to this revision.Feb 11 2020, 7:12 AM

I don't think this belongs to the LLVM dialect. LLVM IR does not have rsqrt as operation or intrinsics, so neither should the dialect. We can have it in a higher-level dialect that lowers to llvm.intr.sqrt (to introduce) and llvm.fdiv (already available). But this expansion should _not_ happen when converting from the LLVM dialect to LLVM IR, that mapping is intentionally kept trivial.

This revision now requires changes to proceed.Feb 11 2020, 7:12 AM
akuegel abandoned this revision.Feb 12 2020, 1:12 AM

Ok, seems we should not have this in the LLVM dialect, so I will abandon this.