This patch moves the following optimization from visitAShr to SimplifyAShrInst :
// Arithmetic shifting an all-sign-bit value is a no-op. unsigned NumSignBits = ComputeNumSignBits(Op0); if (NumSignBits == Op0->getType()->getScalarSizeInBits()) return Op0;
No regression observed. No functionality change.
This patch is part of refactoring code which i have planned along with Rahul Jain.
Primarily, we are targeting code which returns simply value instead of new instruction.
Any suggestions/help/pointers on the same will be very much appreciated.
Please help review this patch.
Thanks,
Suyog