Macroevolution and function in giant theropod dinosaurs