This is a Type 3 conditional sentence, referring to an unreal situation in the past. The structure is If + Past Perfect, ... would have + V3. The sentence implies a missed opportunity in the past. Therefore, 'visit' should be in the past perfect tense, and the main clause should use 'would have visited'.