Phil is correct. It's sort of a toss-up. I've done it both ways, but out of sheer laziness I've mostly used canned pumpkin.
Most of the "pumpkin" flavor you get will come from the spices anyway (some commercial examples actually have no pumpkin).
Squash, yams, sweet potatoes can all be used.
One recommendation I've seen frequently, which I've never done, is to toast the pumpkin (whether canned or not) to bring out more flavor.
If I ever do a pumpkin beer again, I'll try toasting the pumpkin. But I've come to the recent realization that 5 gallons of spiced beer is too much. Maybe I'll come back around to it, but for my efforts, I'd rather have a nice tripel.