@@ -158,57 +158,50 @@ hw.module @SkipIfNoWaits() {
158158}
159159
160160// CHECK-LABEL: @SkipIfWaitHasDestinationOperands(
161- hw.module @SkipIfWaitHasDestinationOperands (in %a: i42 , in %b: i42 ) {
161+ hw.module @SkipIfWaitHasDestinationOperands (in %a: i42 ) {
162162 // CHECK: llhd.process
163- // CHECK: llhd.wait yield ({{.*}} : i42), ^bb2({{.*}} : i42)
164- %0 = llhd.process -> i42 {
165- cf.br ^bb1 (%a : i42 )
166- ^bb1 (%1: i42 ):
167- %false = hw.constant false
168- %c100 = hw.constant 100 : i42
169- cf.cond_br %false , ^bb2 (%1 : i42 ), ^bb3 (%c100 : i42 )
170- ^bb2 (%2: i42 ):
171- llhd.wait yield (%2 : i42 ), ^bb2 (%2 : i42 )
172- ^bb3 (%3: i42 ):
173- %4 = comb.add %3 , %b : i42
174- cf.br ^bb1 (%4 : i42 )
163+ llhd.process {
164+ cf.br ^bb1
165+ ^bb1 :
166+ llhd.wait ^bb2 (%a : i42 )
167+ ^bb2 (%0: i42 ):
168+ cf.br ^bb1
175169 }
176170}
177171
178172// CHECK-LABEL: @SkipIfEntryAndWaitConvergeInWrongSpot(
179173hw.module @SkipIfEntryAndWaitConvergeInWrongSpot (in %a: i42 ) {
180174 // CHECK: llhd.process
181- %c100 = hw.constant 100 : i42
182175 llhd.process {
183- cf.br ^bb2 ( %c100 : i42 )
176+ cf.br ^bb2 // skip logic after wait
184177 ^bb1 :
185178 %0 = comb.add %a , %a : i42
186- cf.br ^bb2 ( %0 : i42 )
187- ^bb2 ( %1 : i42 ) :
188- llhd.wait ( %1 : i42 ), ^bb1
179+ cf.br ^bb2
180+ ^bb2 :
181+ llhd.wait ^bb1
189182 }
190183}
191184
192185// CHECK-LABEL: @SkipIfEntryAndWaitConvergeWithDifferentBlockArgs(
193186hw.module @SkipIfEntryAndWaitConvergeWithDifferentBlockArgs (in %a: i42 , in %b: i42 ) {
194187 // CHECK: llhd.process
195- %0 = llhd.process -> i42 {
188+ llhd.process {
196189 cf.br ^bb2 (%a : i42 )
197190 ^bb1 :
198191 cf.br ^bb2 (%b : i42 )
199192 ^bb2 (%0: i42 ):
200- llhd.wait yield ( %0 : i42 ), ^bb1
193+ llhd.wait ^bb1
201194 }
202195}
203196
204197// CHECK-LABEL: @SkipIfValueUnobserved(
205198hw.module @SkipIfValueUnobserved (in %a: i42 ) {
206199 // CHECK: llhd.process
207- %0 = llhd.process -> i42 {
200+ llhd.process {
208201 cf.br ^bb1
209202 ^bb1 :
210203 %0 = comb.add %a , %a : i42
211- llhd.wait yield ( %0 : i42 ), ^bb1
204+ llhd.wait ^bb1
212205 }
213206}
214207
@@ -244,37 +237,3 @@ hw.module @SkipIfEntryAndWaitConvergeWithSideEffectingOps(in %a : i42) {
244237 llhd.wait yield (%a : i42 ), (%a : i42 ), ^bb1
245238 }
246239}
247-
248- // CHECK-LABEL: @PruneWaitOperands
249- hw.module @PruneWaitOperands (in %clock : i1 , in %f1 : i2 , in %f2 : i3 ) {
250- %false = hw.constant false
251- %c10_i8 = hw.constant 10 : i8
252- %c20_i8 = hw.constant 20 : i8
253- %c100_i10 = hw.constant 100 : i10
254- %c110_i10 = hw.constant 110 : i10
255- %true = hw.constant true
256- // CHECK: llhd.process -> i1, i8, i2, i10, i3 {
257- // CHECK-NEXT: cf.br ^bb1(%c10_i8, %c100_i10 : i8, i10)
258- // CHECK-NEXT: ^bb1(%1: i8, %2: i10):
259- // CHECK-NEXT: llhd.wait yield (%clock, %1, %f1, %2, %f2 : i1, i8, i2, i10, i3), (%clock : i1), ^bb2
260- // CHECK-NEXT: ^bb2:
261- // CHECK: cf.cond_br {{.*}}, ^bb3, ^bb1(%c20_i8, %c110_i10 : i8, i10)
262- // CHECK-NEXT: ^bb3:
263- // CHECK: cf.cond_br {{.*}}, ^bb1(%c10_i8, %c100_i10 : i8, i10), ^bb1(%c20_i8, %c110_i10 : i8, i10)
264- // CHECK-NEXT: }
265- %0:5 = llhd.process -> i1 , i8 , i2 , i10 , i3 {
266- cf.br ^bb1 (%clock , %c10_i8 , %f1 , %c100_i10 , %f2 : i1 , i8 , i2 , i10 , i3 )
267- ^bb1 (%1: i1 , %2: i8 , %3: i2 , %4: i10 , %5: i3 ):
268- llhd.wait yield (%1 , %2 , %3 , %4 , %5 : i1 , i8 , i2 , i10 , i3 ), (%clock : i1 ), ^bb2 (%2 , %1 , %3 , %5 , %4 : i8 , i1 , i2 , i3 , i10 )
269- ^bb2 (%6: i8 , %7: i1 , %8: i2 , %9: i3 , %10: i10 ):
270- %15 = comb.xor bin %7 , %true : i1
271- %16 = comb.and bin %15 , %clock : i1
272- cf.cond_br %16 , ^bb3 , ^bb1 (%clock , %c20_i8 , %f1 , %c110_i10 , %f2 : i1 , i8 , i2 , i10 , i3 )
273- ^bb3 :
274- %25 = comb.and %true , %clock : i1
275- cf.cond_br %25 ,
276- ^bb1 (%clock , %c10_i8 , %f1 , %c100_i10 , %f2 : i1 , i8 , i2 , i10 , i3 ),
277- ^bb1 (%clock , %c20_i8 , %f1 , %c110_i10 , %f2 : i1 , i8 , i2 , i10 , i3 )
278- }
279- hw.output
280- }
0 commit comments