Page MenuHomePhabricator

Add RsqrtOp to LLVM dialect.
AbandonedPublic

Authored by akuegel on Tue, Feb 11, 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

TimeTest
10 msLLVM.Bindings/Go::go.test
Script: -- : 'RUN: at line 1'; llvm-go test llvm.org/llvm/bindings/go/llvm

Event Timeline

akuegel created this revision.Tue, Feb 11, 6:33 AM
akuegel edited the summary of this revision. (Show Details)Tue, Feb 11, 6:34 AM
akuegel added reviewers: herhut, pifon2a.
pifon2a accepted this revision.Tue, Feb 11, 6:57 AM
This revision is now accepted and ready to land.Tue, Feb 11, 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.Tue, Feb 11, 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.Tue, Feb 11, 7:12 AM
akuegel abandoned this revision.Wed, Feb 12, 1:12 AM

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