Page MenuHomePhabricator

Add RsqrtOp to LLVM dialect.

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



Add a convenience Op Rsqrt which is 1 / sqrt.

Also add the SameOperandsAndResultType trait to the Log Op.

Diff Detail

Unit TestsFailed

10 msLLVM.Bindings/Go::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; llvm-go test

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.


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.