Changed implementation of findNeccecaryBitwidth so that takes advantage of the IR