<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 5, 2016 at 5:48 AM, Krzysztof Parzyszek <span dir="ltr"><<a href="mailto:kparzysz@codeaurora.org" target="_blank">kparzysz@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 4/4/2016 5:58 PM, Rail Shafigulin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
What about load instruction? I tried the same approach but I got an error.<br>
<br>
error: In anonymous_570: Type inference contradiction found, merging<br>
'{v4i32:v4f32}' into '{i32:f32}'<br>
<br>
</blockquote>
<br></span>
Try changing this Pat:<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
// Cast load of a floating point vector to use the same<br>
// operation as a load of an integer vector.<br>
def: Pat<(set (v4f32 VR:$rD), (load ADDRri:$src)),<br>
          (VLWZ VR:$rD, ADDRri:$src)>;<br>
</blockquote>
<br></span>
to<br>
<br>
def: Pat<(v4f32 (load ADDRri:$src)),<br>
         (VLWZ ADDRri:$src)>;<br>
<br>
That is, remove the "set" from the input pattern and the output operand from the output pattern.<br>
<br>
Generally, Pats only contain input operands.<br>
<br>
<br>
If you have an error message like the one above, one easy way to locate the problem is to look at the list of all records generated by table-gen:<br>
<br>
$ llvm-tblgen -print-records -I /path/to/llvm/lib/Target/<target> -I /path/to/llvm/lib/Target -I /path/to/llvm/include /path/to/lib/Target/<target>/<target>.td -o output_file<br>
<br>
(This is the same invocation of table-gen as for any other purpose, except for the "-print-records" option instead of the typical -gen-... options.)<br>
<br>
<br>
The output_file will then contain all the records that came out of the .td files, for example:<br>
<br>
def anonymous_1405 {    // Pattern Pat T_CMP_pat<br>
  dag PatternToMatch = (i1 (seteq (i32 IntRegs:$src1), s10ImmPred:$src2));<br>
  list<dag> ResultInstrs = [(C2_cmpeqi IntRegs:$src1, s10ImmPred:$src2)];<br>
  list<Predicate> Predicates = [];<br>
  int AddedComplexity = 0;<br>
  string NAME = ?;<br>
}<br>
<br>
You can look for "anonymous_570" in your case and see where it came from.  The comment after "def anonymous..." is a list of classes from which this definition was inherited.<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
-Krzysztof<br>
<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
</div></div></blockquote></div><br><br clear="all"><div>Has anybody told you, you are a genius!!! Your solution worked, I really appreciate the help. And I will keep in mind the -print records option for the llvm-tbglen.</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Rail Shafigulin<br></div>Software Engineer <br>Esencia Technologies<br></div></div></div></div>
</div></div>