<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1">My target has only logical shifts and lacks an
arithmetic right shift instruction.<br>
I have a custom LowerSRA function that rewrites SRA as SHL + SIGN_EXTEND<br>
when the shift width is either constant 16 or 24.  Unfortunately, I
observe that a<br>
later pass combines the SHL + SIGN_EXTEND back into SRA so we crash.<br>
<br>
The idea I had for defeating this behavior is lower to a target-specific<br>
version of SHL and/or SIGN_EXTEND, rather than using the generic
ISD::SHL<br>
and/or ISD::SIGN_EXTEND.  Is that the recommended way to do it?<br>
<br>
G<br>
<br>
</font>
</body>
</html>