We report a first-principles molecular dynamics study of the equation of state, structural, and elastic properties of MgSiO3 glass at 300 K as a function of pressure up to 170 GPa. We explore two different compression paths: cold compression, in which the zero pressure quenched glass is compressed at 300 K, and hot compression, in which the liquid is quenched in situ at high pressure to 300 K. We also study decompression and associated irreversible densification. Our simulations show that the glass at the zero pressure is composed of primarily Si-O tetrahedra, partially linked with each other via the bridging O atoms (present in 35%; the remaining being the non-bridging O atoms). With increasing pressure, the mean Si-O coordination number gradually increases to 6, with fivefold and subsequently sixfold replacing tetrahedra as the most abundant coordination environment. The Mg-O coordination comprising of a mixture of four-, five-, and sixfold species at zero pressure picks up more high-coordination (seven- to ninefold) species on compression and its mean value increases from 4.5 to 8 over the entire pressure range studied. Consistently, the anion-cation coordination numbers increase on compression with appearance of oxygen tri-clusters (three silicon coordinated O atoms) and mean O-Si coordination eventually reaching 2. Hot compression produces greater densities and higher coordination numbers at all pressures as compared with cold compression, reflecting kinetic hindrances to structural changes. On decompression from 6 GPa, the glass regains its initial uncompressed structure with almost no residual density. Decompression from 27 GPa produces significant irreversible compaction, and the peak-pressure of decompression significantly influences the degree of density retention with as high as 15% residual density on decompression from 170 GPa. Irreversibility arises from the survival of high coordination species to zero pressure on decompression. With increasing pressure, the calculated compressional and shear wave velocities (about 5 and 3 km/s at the ambient conditions) of MgSiO3 glass increase initially rapidly and then more gradually at high pressures. Our results suggest that hot-compressed glasses perhaps provide closer analog to high-pressure silicate melts than the glass on cold compression.