Skip to content

Commit 43a45db

Browse files
committed
Apply feedback
1 parent ab7b98f commit 43a45db

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

llvm/lib/Target/Sparc/DelaySlotFiller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ Filler::findDelayInstr(MachineBasicBlock &MBB,
206206
if (!done)
207207
--I;
208208

209-
// Skip debug and generic instructions.
210-
if (I->isDebugInstr() || (I->getOpcode() <= TargetOpcode::GENERIC_OP_END))
209+
// Skip debug and meta instructions.
210+
if (I->isDebugInstr() || I->isMetaInstruction())
211211
continue;
212212

213213
if (I->hasUnmodeledSideEffects() || I->isInlineAsm() || I->isPosition() ||

llvm/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -184,29 +184,28 @@ entry:
184184
ret i32 %2
185185
}
186186

187-
define i32 @test_generic_inst(i32 %a) #0 {
187+
define i32 @test_generic_inst(i32 %arg) #0 {
188188
;CHECK-LABEL: test_generic_inst:
189189
;CHECK: ! fake_use: {{.*}}
190190
;CHECK: bne {{.*}}
191191
;CHECK-NEXT: nop
192-
193-
%2 = call i32 @bar(i32 %a)
194-
%3 = and i32 %2, 1
195-
%4 = icmp eq i32 %3, 0
192+
%bar1 = call i32 @bar(i32 %arg)
193+
%even = and i32 %bar1, 1
194+
%cmp = icmp eq i32 %even, 0
196195
; This shouldn't get reordered into a delay slot
197-
call void (...) @llvm.fake.use(i32 %a)
198-
br i1 %4, label %5, label %7
199-
5:
200-
%6 = call i32 @bar(i32 %2)
201-
br label %9
202-
203-
7:
204-
%8 = add nsw i32 %2, 1
205-
br label %9
206-
207-
9:
208-
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
209-
ret i32 %10
196+
call void (...) @llvm.fake.use(i32 %arg)
197+
br i1 %cmp, label %true, label %false
198+
true:
199+
%bar2 = call i32 @bar(i32 %bar1)
200+
br label %cont
201+
202+
false:
203+
%inc = add nsw i32 %bar1, 1
204+
br label %cont
205+
206+
cont:
207+
%ret = phi i32 [ %bar2, %true ], [ %inc, %false ]
208+
ret i32 %ret
210209
}
211210

212211
declare void @llvm.fake.use(...)

0 commit comments

Comments
 (0)