How can a rigid body's weight do work on it to make it rotate? Consider a cylinder that rolls without sliding on an inclined plane. If it's placed at the top of the plane, with its center of mass at a height $h$ from the bottom, it will have a potential energy $mgh$ (considering the bottom of the plane as the zero point). Then, the cylinder will start rolling down the plane, as its weight does work on it, causing its potential energy to be transformed into rotational and translational kinetic energy.
I'm confused about the origin of the rotational kinetic energy of the cylinder. Since the static friction and the normal force are applied at the point of contact with the plane, neither of them can do work on the cylinder (which is why its mechanical energy is conserved), since the cylinder is, by constraint, not sliding. This seems to imply that the cylinder's rotational kinetic energy comes from the work done by its weight.
However, I don't understand how this happens, since a rigid body's weight can be seen as being applied on its center of mass, which means it can exert no torque on it. Instead, the only torque exerted with respect to its center of mass comes from static friction.
Moreover, if the inclined plane was frictionless, there would be no torque exerted on the cylinder, so it would not rotate. Yet, I don't see how this situation could be distinguished from the previous one by only looking at the cylinder's mechanical energy (since the normal force would still be doing no work).
So, my question is: how is gravitational potential energy converted into rotational kinetic energy, and what is friction's role on this?
 A: It is important to keep in mind that there are three different conserved quantities of interest here: linear momentum, angular momentum, and energy. Rotational kinetic energy is not itself a conserved quantity.
Each of the conserved quantities has an associated rate of change, or “flow”. The rate of change of linear momentum is the force, the rate of change of the angular momentum is the torque, and the rate of change of the energy is the power.
Each interaction can produce all three: force, torque, and power. It is not necessary that the force which delivers torque also deliver power.
For a disk rolling without slipping there are two interactions, the gravitational interaction and the friction interaction. Assuming no dissipation, it is straightforward to show that the change in the linear momentum is equal to the sum of the frictional and gravitational forces, that the change in the angular momentum (about the center of mass) is equal to the torque from the friction only, and that the change in the energy is equal to the power from gravity only.
It is incorrect to assume that the torque must provide any energy. It does not. It only provides angular momentum. Only the power provides energy, and that comes entirely from the gravitational interaction. The frictional interaction provides torque. It does not provide power, although it does provide a constraint which splits the power into rotational and translational KE. Providing such a constraint does not itself require energy.
A: For a friction force $\vec F_{fric}$, the work done by friction for planar motion is $\int \vec F_{fric} \cdot\vec vdt$ +  $ \int \vec \tau_{fric} \cdot\vec \omega dt$ where $\vec v$ is the velocity of the CM, $\vec \tau_{fric}$ is the torque about the CM due to the force of friction, and $\vec \omega$ is the angular velocity about the CM.  The work done by friction has two terms: the work done by friction on the CM ,$\int \vec F_{fric} \cdot\vec vdt$, and the work done by friction with respect to the CM ,$ \int \vec \tau_{fric} \cdot\vec \omega dt$.  For certain situations the sum of these two terms is zero and friction does no work (such as rolling without slipping), while for other situations the sum of these two terms is not zero and friction does work (such as slipping).  See Consistent Approach for Calculating Work By Friction for Rigid Body in Planar Motion
A: 
I'm confused about the origin of the rotational kinetic energy of the
cylinder. Since the static friction and the normal force are applied
at the point of contact with the plane, neither of them can do work on
the cylinder (which is why its mechanical energy is conserved), since
the cylinder is, by constraint, not sliding. This seems to imply that
the cylinder's rotational kinetic energy comes from the work done by
its weight.

Simply put, the origin of the rotational kinetic energy is the splitting up of the initial gravitational potential energy into translational kinetic energy plus rotational kinetic energy, instead of just converting to translational kinetic energy, which is the case for pure sliding. The rotational kinetic energy is due to the net torque about the center of mass (CM) of the cylinder created by the static friction force.
Consider the following:

*

*Without static friction, the cylinder would slide down the inclined plane without rotating. Then its kinetic energy would strictly be the translational kinetic energy of its center of mass (CM) and you would have

$$mgh=\frac{1}{2}mv_{cm}^{2}$$
Where $h$ would be the vertical distance traveled by the CM and $v_{cm}$ is the velocity of the CM at the bottom of the incline.
Which would give you a final velocity for sliding without rotating of
$$v_{cm}=\sqrt{2gh}$$


*With static friction and no sliding, the static friction causes a torque about the CM and thus rotation about the CM in addition to translation of the CM . Now the initial potential energy is divided up between translational and rotational kinetic energy, and equals the sum of the translational and rotational kinetic energies of the cylinder at the bottom of the incline, or

$$mgh=\frac{1}{2}mv_{cm}^{2}+\frac{1}{2}I\omega^2$$
Where $I$ is the moment of inertia of the cylinder and $\omega$ is its angular velocity. For a solid cylinder of radius $r$,
$$I=\frac{1}{2}mr^2$$
and
$$\omega=\frac{v_{cm}}{r}$$
Plugging the last two equations into the previous equation we get
$$v_{cm}^{2}=\frac{3}{4}gh$$
$$v_{cm}=\sqrt{\frac{4}{3}gh}$$
Note the the velocity (and translational kinetic energy) of the center of mass for the rotating cylinder at the bottom of the incline is less than the velocity (and translational kinetic energy) of the cylinder that slides down the incline without rotating because of no static friction. This has to be so because the initial gravitational potential energy is divided up into translational and rotational kinetic energy.
There's no such thing as a free lunch!

But I'm still somewhat confused by this. Since the rotational kinetic
energy of the cylinder comes from the potencial gravitational energy
that it had at the top of the plane, it must be the case that its
weight is doing work that causes to rotate. But I don't understand how
this can happen, since weight exerts no torque around the center of
mass.

It is the static friction force that causes the torque about the CM, not the weight. The torque $\tau$ caused by the static friction force $F_s$ where the radius of the cylinder is $r$ is
$$\tau = F_{s}r$$
The weight limits the maximum possible static friction force. If the maximum static friction force is exceeded, the cylinder will start to slide.
The maximum possible static friction force is
$$F_{s-max}=\mu N= \mu mgcos\theta$$
Where $\theta$ is the angle of the incline and $\mu$ is the coefficient of static friction. In order for the cylinder to roll without sliding,
$$F_{s}<\mu N$$
I have included the free body diagrams below of the cylinder sliding without rolling and rolling without sliding.
Hope this helps.

A: The confusion, I believe is because of static friction acting on the cylinder. Since its not kinetic friction that's acting here, the general formula $f=\mu N$ is rendered invalid. It is to be noted that friction is the only force that is providing a torque for the cylinder to roll and not just slide, like in your second case, where the cylinder is placed on a friction-less incline.
Considering your first example, Free body diagram suggests that
$mgsin\theta-f=ma$
(here f is the frictional force acting on the cylinder, m is the mass of the cylinder, a is the net acceleration, and $\theta$ is the angle of inclination)
From the relation of net torque with angular acceleration,
$\tau=I\alpha$
$\Rightarrow Rf=\frac{MR^{2}}{2}\times \frac{a}{R}$
(where I is the moment of inertia of the solid cylinder ($MR^{2}/2$ in this case), R is the radius of the cylinder and $\alpha$ is the angular acceleration of the cylinder)
By solving these equations we get,
$f=\frac{mg}{2}$
and not mg, the result we would've gotten if we had just directly substituted $f=\mu N$
To sum up, it is due to the torque acting on the cylinder by the frictional force that the cylinder acquires some amount of rotational kinetic energy
