[all-commits] [llvm/llvm-project] e1cad4: [X86] Make getX86TargetCPU return std::string inst...

topperc via All-commits all-commits at lists.llvm.org
Thu Aug 6 13:18:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e1cad4234cf3a3d0747c140e135e413ece22cf63
      https://github.com/llvm/llvm-project/commit/e1cad4234cf3a3d0747c140e135e413ece22cf63
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M clang/lib/Driver/ToolChains/Arch/X86.cpp
    M clang/lib/Driver/ToolChains/Arch/X86.h

  Log Message:
  -----------
  [X86] Make getX86TargetCPU return std::string instead of const char *. Remove call to MakeArgString. NFCI

I believe this function used to be called directly from X86
specific code and was used to immediately create -target-cpu
command line. A later refactoring changed it to to be called from
a generic getCPU function that returns std::string. So on some
paths we created a string using MakeArgString converted that to
std::string then called MakeArgString again from that.

Instead just return std::string directly like the other targets.


  Commit: 4df38a5589f6fa23e161a76bdaa3180ad053791e
      https://github.com/llvm/llvm-project/commit/4df38a5589f6fa23e161a76bdaa3180ad053791e
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M clang/lib/Driver/ToolChains/Arch/X86.cpp

  Log Message:
  -----------
  [X86] Optimize out a few extra strlen calls in getX86TargetCPU. NFCI

We had a conversion from const char * to StringRef and const char *
to std::string conversion. These both do their own
strlen call if the compiler doens't figure out how to share them.
By adding the temporary StringRef we can convert it to std::string
instead.

The other case is to use a StringSwitch<StringRef> instead of
StringSwitch<const char *> since the output values of the switch
are string literals. This allows the length to be computed at
compile time. Otherwise we have to convert from const char *
to std::string after the StringSwitch.


  Commit: ffc248f3b88cd6a0153d23660727b45dde8f27b5
      https://github.com/llvm/llvm-project/commit/ffc248f3b88cd6a0153d23660727b45dde8f27b5
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
    M llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
    A llvm/test/CodeGen/SystemZ/pr47019.ll

  Log Message:
  -----------
  [LegalTypes] Move VSELECT node creation out of WidenVSELECTAndMask and push to 2 of the 3 callers.

One of the callers only wants the condition, but the vselect can
be simplified by getNode making it hard or impossible to retrieve
the condition.

Instead, return the condition and make the other 2 callers
responsible for creating the vselect node using the condition.
Rename the function to WidenVSELECTMask accordingly.

Differential Revision: https://reviews.llvm.org/D85468


Compare: https://github.com/llvm/llvm-project/compare/87cba434027b...ffc248f3b88c


More information about the All-commits mailing list