From 40b140fef122f429327d494ef2f6c2f71a06ce3f Mon Sep 17 00:00:00 2001 From: Nicolai Haehnle Date: Thu, 22 Feb 2018 15:25:11 +0000 Subject: [PATCH] AMDGPU: Stop using .NAME in .td files Summary: .NAME is a bit of an odd duck, in that we should really treat it like a template argument, but we currently don't, and so when and where NAME is initialized and how is pretty inconsistent. Best to just avoid using it as a field of already instantiated records, and use cast to string instead. Change-Id: I5a0c202401cede3d5c3827ab9c7858ea48b29108 Reviewers: arsenm, rampitec Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D43551 llvm-svn: 325794 --- llvm/lib/Target/AMDGPU/DSInstructions.td | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/DSInstructions.td b/llvm/lib/Target/AMDGPU/DSInstructions.td index 1c38a0f..ec85da7 100644 --- a/llvm/lib/Target/AMDGPU/DSInstructions.td +++ b/llvm/lib/Target/AMDGPU/DSInstructions.td @@ -600,8 +600,6 @@ class DSReadPat : GCNPat < (inst $ptr, (as_i16imm $offset), (i1 0)) >; -// FIXME: Passing name of PatFrag in workaround. Why doesn't -// !cast(frag.NAME#"_m0") work!? multiclass DSReadPat_mc { let OtherPredicates = [LDSRequiresM0Init] in { @@ -609,7 +607,7 @@ multiclass DSReadPat_mc { } let OtherPredicates = [NotLDSRequiresM0Init] in { - def : DSReadPat(inst.NAME#"_gfx9"), vt, !cast(frag)>; + def : DSReadPat(!cast(inst)#"_gfx9"), vt, !cast(frag)>; } } @@ -678,7 +676,7 @@ multiclass DSWritePat_mc { } let OtherPredicates = [NotLDSRequiresM0Init] in { - def : DSWritePat(inst.NAME#"_gfx9"), vt, !cast(frag)>; + def : DSWritePat(!cast(inst)#"_gfx9"), vt, !cast(frag)>; } } @@ -732,7 +730,8 @@ multiclass DSAtomicRetPat_mc { } let OtherPredicates = [NotLDSRequiresM0Init] in { - def : DSAtomicRetPat(inst.NAME#"_gfx9"), vt, !cast(frag)>; + def : DSAtomicRetPat(!cast(inst)#"_gfx9"), vt, + !cast(frag)>; } } @@ -749,7 +748,8 @@ multiclass DSAtomicCmpXChg_mc { } let OtherPredicates = [NotLDSRequiresM0Init] in { - def : DSAtomicCmpXChg(inst.NAME#"_gfx9"), vt, !cast(frag)>; + def : DSAtomicCmpXChg(!cast(inst)#"_gfx9"), vt, + !cast(frag)>; } } -- 2.7.4