aco: add Instruction::usesModifiers() and add more checks in the optimizer