As discussed in https://reviews.llvm.org/D120111, this patch proposes an alternative implementation to avoid scanning feature list for architecture version over and over again. The insertion position for default extensions is also captured during this single scan of the feature list. Differential Revision: https://reviews.llvm.org/D120864