Skip to content

Commit

Permalink
[X86][CodeGen] Set mayLoad = 1 for LZCNT/POPCNT/TZCNTrm_(EVEX|NF)
Browse files Browse the repository at this point in the history
Promoted and NF LZCNT/POPCNT/TZCNT were supported in llvm#79954.
B/c null_frag is used in the patterns for these variants, tablgen can
not infer mayLoad = 1 for them.

This can be tested by MCA tests, which will be added after
-mcpu=<cpu_with_apx> is supported.
  • Loading branch information
KanRobert committed Feb 1, 2024
1 parent 6ff431b commit 1395e58
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions llvm/lib/Target/X86/X86InstrMisc.td
Original file line number Diff line number Diff line change
Expand Up @@ -1166,11 +1166,12 @@ multiclass Lzcnt<bits<8> o, string m, SDPatternOperator node, X86TypeInfo t,
[(set t.RegClass:$dst, (node t.RegClass:$src1)),
(implicit EFLAGS)]>,
TB, Sched<[schedrr]>;
def rm#suffix : ITy<o, MRMSrcMem, t, (outs t.RegClass:$dst),
(ins t.MemOperand:$src1), m, unaryop_ndd_args,
[(set t.RegClass:$dst, (node (t.LoadNode addr:$src1))),
(implicit EFLAGS)]>,
TB, Sched<[schedrm]>;
let mayLoad = 1 in
def rm#suffix : ITy<o, MRMSrcMem, t, (outs t.RegClass:$dst),
(ins t.MemOperand:$src1), m, unaryop_ndd_args,
[(set t.RegClass:$dst, (node (t.LoadNode addr:$src1))),
(implicit EFLAGS)]>,
TB, Sched<[schedrm]>;
}

let Predicates = [HasLZCNT], Defs = [EFLAGS] in {
Expand Down

0 comments on commit 1395e58

Please sign in to comment.