[llvm-dev] EFLAGS

Chris Sears via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 20 11:13:57 PST 2021


What is the difference between

    Uses = [EFLAGS] + Defs = [EFLAGS]

and their mention in selection patterns?

    [(set GR64:$dst, EFLAGS, (X86smul_flag GR64:$src1, GR64:$src2))]

Basically, my problem is that I have weird instructions which undef the
EFLAGS register, leaving EFLAGS in an unknown state. For example:

    cmp x, y
    beq z           ; this is good because EFLAGS is defined

    cmp x, y
    weird_inst.   ; undefs EFLAGS, leaves EFLAGS in a undefined state
    beq z           ; this is bad because EFLAGS is undefined

Is it enough to just say Defs = [EFLAGS] for the Instruction def of
weird_inst? Or is it necessary for the pattern to say something like [(set
EFLAGS, undef)] as well?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210120/c38babc2/attachment.html>


More information about the llvm-dev mailing list