[flang-dev] (Strawman) Costed plan for LLVM-ification of F18

David Greene via flang-dev flang-dev at lists.llvm.org
Wed Jan 29 13:15:50 PST 2020


Timothy Keith via flang-dev <flang-dev at lists.llvm.org> writes:

>> 1. Eliminate braces from all single-line if statements
>
> This seems like a really bad idea and would like to see a reason for it.

FWIW this is one of the few things in LLVM's coding standards that I
strongly disagree with, but for whatever reason others strongly support
it.  I just live with it.  I would enthusiastically support an RFC to
llvm-dev to change it.

>> 2. Eliminate all uses of else-after-return
>
> Doing this blindly is also a bad idea.

I don't think anyone is saying to do anything "blindly."

>> b. std::vector → llvm::SmallVector where appropriate
>> c. std::set → llvm::SmallSet/llvm::StringSet/llvm::DenseSet where appropriate
>> d. std::map → llvm::StringMap/llvm::DenseMap where appropriate
>
> As long as "where appropriate" means there is tangible benefit to
> changing from a standard type to a non-standard one. Not just change
> for the sake of change.

IME, LLVM's data structures are much faster/less resource intensive than
the standard library's.  That's natural as the standard library is
general-purpose code while LLVM's is tuned for specific use-cases.  In
my work I always use LLVM's data structures unless there's a good reason
not to.  f18 should follow the LLVM convention here.

                     -David


More information about the flang-dev mailing list