[xla:cpu] Re-enable znver3-specific codegen
Fix has landed in LLVM
https://github.com/llvm/llvm-project/commit/7ae5d00afaf39fae78e411cb44f665e1dc52b356
PiperOrigin-RevId: 466656508
diff --git a/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc b/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc
index a7ce774..9c951ef 100644
--- a/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc
+++ b/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc
@@ -79,14 +79,6 @@
return result;
}
-llvm::StringRef DetectHostCpuName() {
- auto cpu = llvm::sys::getHostCPUName();
- // TODO(b/238469947): Targeting znver3 triggers a very deep recursion in LLVM.
- // Fall back to zen 2 until https://reviews.llvm.org/D129745 lands to avoid
- // running out of stack.
- return cpu == "znver3" ? "znver2" : cpu;
-}
-
} // namespace
/*static*/ std::unique_ptr<llvm::TargetMachine>
@@ -99,7 +91,7 @@
.setOptLevel(opt_level)
.selectTarget(
/*TargetTriple=*/llvm::Triple(), /*MArch=*/"",
- /*MCPU=*/DetectHostCpuName(),
+ /*MCPU=*/llvm::sys::getHostCPUName(),
/*MAttrs=*/DetectMachineAttributes()));
CHECK(target_machine != nullptr);
return target_machine;