There is no need to cut the squash. Place it whole on the trivet in the Instant Pot. Pour in 1 cup of water.
Secure the lid and set the vent to sealing (if necessary for your model).
Set to cook on high pressure for 20 minutes. When done, allow the pressure to release naturally.
Carefully pull the trivet with the squash on it out of the Instant Pot. Allow it to cool for 10 minutes. Peel back the skin, cut in half, and scoop out the seeds.
Clean the pot and return it to the machine. Turn on saute mode. Add the oil and when hot, add the onion and saute for 3 minutes. Add the garlic, rosemary, salt, and pepper. Turn off saute mode.
Add the squash and stock to the pot. Secure the lid and set the vent to sealing (if necessary for your model). Pressure cook on high for 4 minutes. When done, do a quick release of the pressure.
Add the butter to the pot and let it melt.
Puree the soup with an immersion blender until silky smooth, about 3 minutes.
Season to taste. Garnish with fresh herbs, if desired.
Notes
To make the soup creamier, you can add 1/4 to 1/2 cup of heavy cream after blending.