Originally, the -i- of the future perfect was short and the -i- of the perfect subjunctive was long, but these forms became confused, since, apart from vowel quantity, they are identical in all forms except the first person singular (and originally, the third person plural). Generally, the -i- was shortened in all forms, but the long -i- was preserved in poetry when metrically convenient.
Some metrical shapes don't fit in the hexameter. Ovid has dederitis, a future perfect with long -i-, at Metamorphoses 6.357, and Vergil has egerimus, a perfect subjunctive with short -i- at Aeneid 6.514. Dederitis with a short -i- would yield a tribrach (three short syllables in a row), which can't fit in the hexameter; egerimus with a long -i- would yield a cretic (long-short-long), which is equally impermissible in the hexameter.
Source: A. Ernout, Morphologie historique du latin, sec. 308, pp. 217-9.