My understanding is that it is legal to have allocas in any basic block. However, the mem2reg pass only recognizes allocas in the entry block of a function as candidate for conversion into registers. So if you're hoping to use mem2reg, it won't work if you place your allocas elsewhere. -Srikumar