[all-commits] [llvm/llvm-project] addbf7: [X86] Reorder how the subtarget map key is created.

topperc via All-commits all-commits at lists.llvm.org
Thu Jul 16 21:43:24 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: addbf732c83b54259d6aa2c6ed982099be0aeeaf
      https://github.com/llvm/llvm-project/commit/addbf732c83b54259d6aa2c6ed982099be0aeeaf
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-07-16 (Thu, 16 Jul 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86TargetMachine.cpp

  Log Message:
  -----------
  [X86] Reorder how the subtarget map key is created.

We use a SmallString<512> and attempted to reserve enough space
for CPU plus Features, but that doesn't account for all the things
that get added to the string.

Reorder the string so the shortest things go first which shouldn't
exceed the small size. Finally add the feature string at the end
which might be long. This should ensure at most one heap allocation
without needing to use reserve.

I don't know if this matters much in practice, but I was looking
into something else that will require more code here and noticed
the odd reserve call.




More information about the All-commits mailing list