Requesting clarification about the weapon grinder

I recently heard about this feature from a friend who got the game, and that it’s possible to force a chance of the grinder popping out a specific type of legendary, by using a combination of two orange gears followed by a purple of the weapon type you want.

Here’s where I need clarification, though…

Let’s say I used a purple Assault Rifle as the last ingredient, in the hopes of getting a Legendary assault rifle…

If the attempt succeeds, will the grinder actually “Legend-ify” the purple AR I tossed in, thereby boosting its stats to the level of a Legendary gear piece and maybe adding an extra effect?

Or will the game just select a random pre-existing Legendary Assault Rifle to give me instead?

I haven’t found clarification on that yet, so I’m hoping it’s the former.
I keep having pleasant day-dreams of tossing my favorite purple spinny-gun from BL2 into the grinder and seeing it pop back out as an orange with insane stats…

If they made that a feature for BL2, using Eridium in place of Moonstones, I’d be one happy Commando…

This.

Well damn, there goes my dream of “Legend-ify-ing” a purple Torgue spini-gun…

grinder results are all random. the only thing you can guarantee is weapon type by grinding 2 non DLC legendaries with a purple weapon that you want and with moonstone.