Season both sides of the fish with the salt and pepper. Sprinkle half of the garlic in a baking dish and top with the swordfish. Sprinkle with the remaining garlic. Set aside for 10 minutes.
Heat grill to medium. Brush grill rack with oil.
Scrape the garlic from the fish. Transfer the fish to grill and cook, turning once, until opaque throughout, about 8 minutes total. Serve with the Grilled Pineapple Salsa.