llvm.org GIT mirror llvm / 81cd7ff
Fix a tblgen bug. Given the pattern below as an example: list<dag> Pattern = [(set RC:$dst, (v4f32 (shufp:src3 RC:$src1, (mem_frag addr:$src2))))]; The right reference resolving should lead to: list<dag> Pattern = [(set VR128:$dst, (v4f32 (shufp:src3 VR128:$src1, (mem_frag addr:$src2))))]; But was yielding: list<dag> Pattern = [(set VR128:$dst, (v4f32 (shufp VR128:$src1, (mem_frag addr:$src2))))]; Fix this by passing the right name when creating a new DagInit node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106670 91177308-0d34-0410-b5e6-96231b3b80d8 Bruno Cardoso Lopes 10 years ago
2 changed file(s) with 25 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 // RUN: tblgen %s | FileCheck %s
1 // XFAIL: vg_leak
2
3 class Instr pat> {
4 list Pattern = pat;
5 }
6
7 class Reg {
8 int a = 3;
9 }
10
11 def VR128 : Reg;
12 def mem_frag;
13 def set;
14 def addr;
15 def shufp : Reg;
16
17 multiclass shuffle {
18 def rri : Instr<[(set RC:$dst, (shufp:$src3
19 RC:$src1, RC:$src2))]>;
20 }
21
22 // CHECK: shufp:src3
23 defm ADD : shuffle;
12611261 Init *Op = Val->resolveReferences(R, RV);
12621262
12631263 if (Args != NewArgs || Op != Val)
1264 return new DagInit(Op, "", NewArgs, ArgNames);
1264 return new DagInit(Op, ValName, NewArgs, ArgNames);
12651265
12661266 return this;
12671267 }