[llvm] [X86] Remove redundant TEST after shifts when count is non-zero (PR #169069)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 26 06:01:27 PST 2025


================
@@ -689,3 +689,43 @@ let Predicates = [HasBMI2, HasEGPR] in {
   defm SHRX : ShiftX_Pats<srl, "_EVEX">;
   defm SHLX : ShiftX_Pats<shl, "_EVEX">;
 }
+
+let Predicates = [NoNDD] in {
+  // SHL
+  def : Pat<(X86shl GR8:$src1),  (SHL8rCL  GR8:$src1)>;
+  def : Pat<(X86shl GR16:$src1), (SHL16rCL GR16:$src1)>;
+  def : Pat<(X86shl GR32:$src1), (SHL32rCL GR32:$src1)>;
+  def : Pat<(X86shl GR64:$src1), (SHL64rCL GR64:$src1)>;
----------------
RKSimon wrote:

is the CL + EFLAGS binding correct here?

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


More information about the llvm-commits mailing list