[llvm-dev] Failure to match a DAG after a minor pattern change in a custom Target

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Fri Feb 26 06:31:36 PST 2016


On 2/22/2016 1:50 PM, Rail Shafigulin wrote:
> Would you mind showing how to make Esenciasetflag to actually set a
> flag? I can't figure out the syntax.

Is the "setflag" instruction setting something in a special register 
(such as EFLAGS on x86)?  If so, then you can add "let Defs [xyz] in 
..." to your .td definition of that instruction and leave the "set" out 
of the pattern.

The type that you defined
   def SDT_EsenciaSetFlag      : SDTypeProfile<0, 3, [SDTCisSameAs<0, 1>]>;
indicates 0 return values, so it would match this approach.

If the instructions is intended to actually produce a value that could 
be stored in an allocatable register, then you'd need to change the type 
to have 1 return value.  The selection pattern would likely work as is.

-Krzysztof


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation


More information about the llvm-dev mailing list