[llvm] [X86][CodeGen] Prefer KMOVkk_EVEX than KMOVkk when EGPR is supported (PR #74048)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 02:06:01 PST 2023


================
@@ -625,8 +625,10 @@ void X86DomainReassignment::initConverters() {
   createReplacerDstCOPY(X86::MOVZX64rm16,
                         HasEGPR ? X86::KMOVWkm_EVEX : X86::KMOVWkm);
 
-  createReplacerDstCOPY(X86::MOVZX32rr16, X86::KMOVWkk);
-  createReplacerDstCOPY(X86::MOVZX64rr16, X86::KMOVWkk);
+  createReplacerDstCOPY(X86::MOVZX32rr16,
+                        HasEGPR ? X86::KMOVWkk_EVEX : X86::KMOVWkk);
+  createReplacerDstCOPY(X86::MOVZX64rr16,
+                        HasEGPR ? X86::KMOVWkk_EVEX : X86::KMOVWkk);
----------------
KanRobert wrote:

I think it's probably not worth it. First, KMOV may be the only instruction that needs to be promoted in CPP, and other instructions are implemented in TD through predicate HasEGPR/NoEGPR. Second, looking up the table will change the complexity from O(1) to O(lgN) and increase compile time.

https://github.com/llvm/llvm-project/pull/74048


More information about the llvm-commits mailing list