[X86] Move the implicit enabling of sse2 for 64-bit mode from X86Subtarget::initSubta...
authorCraig Topper <craig.topper@intel.com>
Fri, 24 Jul 2020 18:10:28 +0000 (11:10 -0700)
committerCraig Topper <craig.topper@intel.com>
Fri, 24 Jul 2020 18:14:20 +0000 (11:14 -0700)
commit945ed22f3397f52469618cd8a94207665f25bebd
treea733944c4040f7208a30f09f3c9aefbb89d22f97
parent809600d6642773f71245f76995dab355effc73af
[X86] Move the implicit enabling of sse2 for 64-bit mode from X86Subtarget::initSubtargetFeatures to X86_MC::ParseX86Triple.

ParseX86Triple already checks for 64-bit mode and produces a
static string. We can just add +sse2 to the end of that static
string. This avoids a potential reallocation when appending it
to the std::string at runtime.

This is a slight change to the behavior of tools that only use
MC layer which weren't implicitly enabling sse2 before, but will
now. I don't think we check for sse2 explicitly in any MC layer
components so this shouldn't matter in practice. And if it did
matter the new behavior is more correct.
llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
llvm/lib/Target/X86/X86Subtarget.cpp