[llvm] r312822 - AMDGPU: Start using !con operator
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 8 12:09:13 PDT 2017
Author: arsenm
Date: Fri Sep 8 12:09:13 2017
New Revision: 312822
URL: http://llvm.org/viewvc/llvm-project?rev=312822&view=rev
Log:
AMDGPU: Start using !con operator
We have a lot of operand definition work essentially producing
every valid permutation of operands to workaround builiding
operand lists based on the instruction features. Apparently tablegen
already has a mostly undocumented operator to concat dags which
simplies this.
Convert one simple place to use this. The BUF instruction definitions
have much more complicated logic that can be totally rewritten now.
Modified:
llvm/trunk/lib/Target/AMDGPU/FLATInstructions.td
Modified: llvm/trunk/lib/Target/AMDGPU/FLATInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/FLATInstructions.td?rev=312822&r1=312821&r2=312822&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/FLATInstructions.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/FLATInstructions.td Fri Sep 8 12:09:13 2017
@@ -128,13 +128,12 @@ class FLAT_Load_Pseudo <string opName, R
bit HasSignedOffset = 0, bit HasSaddr = 0, bit EnableSaddr = 0> : FLAT_Pseudo<
opName,
(outs regClass:$vdst),
- !if(EnableSaddr,
- !if(HasSignedOffset,
- (ins VReg_64:$vaddr, SReg_64:$saddr, offset_s13:$offset, GLC:$glc, slc:$slc),
- (ins VReg_64:$vaddr, SReg_64:$saddr, offset_u12:$offset, GLC:$glc, slc:$slc)),
- !if(HasSignedOffset,
- (ins VReg_64:$vaddr, offset_s13:$offset, GLC:$glc, slc:$slc),
- (ins VReg_64:$vaddr, offset_u12:$offset, GLC:$glc, slc:$slc))),
+ !con(
+ !con(
+ !con((ins VReg_64:$vaddr),
+ !if(EnableSaddr, (ins SReg_64:$saddr), (ins))),
+ (ins !if(HasSignedOffset,offset_s13,offset_u12):$offset)),
+ (ins GLC:$glc, slc:$slc)),
" $vdst, $vaddr"#!if(HasSaddr, !if(EnableSaddr, ", $saddr", ", off"), "")#"$offset$glc$slc"> {
let has_data = 0;
let mayLoad = 1;
@@ -148,13 +147,12 @@ class FLAT_Store_Pseudo <string opName,
bit HasSignedOffset = 0, bit HasSaddr = 0, bit EnableSaddr = 0> : FLAT_Pseudo<
opName,
(outs),
- !if(EnableSaddr,
- !if(HasSignedOffset,
- (ins VReg_64:$vaddr, vdataClass:$vdata, SReg_64:$saddr, offset_s13:$offset, GLC:$glc, slc:$slc),
- (ins VReg_64:$vaddr, vdataClass:$vdata, SReg_64:$saddr, offset_u12:$offset, GLC:$glc, slc:$slc)),
- !if(HasSignedOffset,
- (ins VReg_64:$vaddr, vdataClass:$vdata, offset_s13:$offset, GLC:$glc, slc:$slc),
- (ins VReg_64:$vaddr, vdataClass:$vdata, offset_u12:$offset, GLC:$glc, slc:$slc))),
+ !con(
+ !con(
+ !con((ins VReg_64:$vaddr, vdataClass:$vdata),
+ !if(EnableSaddr, (ins SReg_64:$saddr), (ins))),
+ (ins !if(HasSignedOffset,offset_s13,offset_u12):$offset)),
+ (ins GLC:$glc, slc:$slc)),
" $vaddr, $vdata"#!if(HasSaddr, !if(EnableSaddr, ", $saddr", ", off"), "")#"$offset$glc$slc"> {
let mayLoad = 0;
let mayStore = 1;
More information about the llvm-commits
mailing list