What sex are your piggies? A 3x3 will be fine for two sows, but it won’t be big enough for two boars.
you’d need a 4x3 for two boars.
loft spaces do not count towards the cage size.
EDIT - just seen your user name - does this mean you do have two boars? (Not sure if it means two human boys or two piggy boys!)
as per my comment above, two boars need more space and a 3x3 would be pushing it.
for two boars a 4x2 would be too small as well, they need a 5x2.
the easiest way to roughly compare is that a 4x2 (big enough for two sows) uses 12 grids, so you can then configure your cage using those 12, so a 3x3 is comparable as it also uses 12 grids
for two boars a 5x2 which uses 14 grids, so again, you can then configure those 14 grids.
(there are obviously limitations to that guide as you can’t have a cage one grid wide)