<div dir="ltr">Hello LLVM Devs,<div><br></div><div>I am working on a target on which no SHL instruction is available. So wanted to expand it through MUL. But currently it is only possible to expand SHL for vector types.</div><div><br></div><div>One possible reason I can think is because LLVM tries to optimize MUL to SHL in certain cases and that can make compiler co in loop or may end up generating wrong code.</div><div><br></div><div>But I think SHL should be able to expanded to MUL and to prevent looping between MUL and SHL we can put a condition that only optimize MUL to SHL when SHL is not expanded operation. The similar logic can be applied to DIV and SRA.</div><div><br></div><div>If there is any other reasons for not doing this, kindly explain.</div><div><br></div><div>Sincerely,</div><div>Vivek</div></div>