Skip to content

Commit 16019aa

Browse files
author
Sanjiv Gupta
committed
Mark sublw_cc and subfw_cc as Terminator insns so that they are part of the terminator insns for a basic block alongwith branch insns. This way a copy is not getting inserted between cmp and branch during PHIElimination disturbing the status flags.
llvm-svn: 74992
1 parent a21d3da commit 16019aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Target/PIC16/PIC16InstrInfo.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,9 @@ def subfw_2: SUBFW<0, "subwf", subc>;
375375
let Uses = [STATUS] in
376376
def subfwb: SUBFW<0, "subwfb", sube>; // With Borrow.
377377

378-
def subfw_cc: SUBFW<0, "subwf", PIC16Subcc>;
379378
}
379+
let Defs = [STATUS], isTerminator = 1 in
380+
def subfw_cc: SUBFW<0, "subwf", PIC16Subcc>;
380381

381382
// [F] -= W ;
382383
let mayStore = 1 in
@@ -425,8 +426,9 @@ class SUBLW<bits<6> opcode, SDNode OpNode> :
425426
let Defs = [STATUS] in {
426427
def sublw_1 : SUBLW<0, sub>;
427428
def sublw_2 : SUBLW<0, subc>;
428-
def sublw_cc : SUBLW<0, PIC16Subcc>;
429429
}
430+
let Defs = [STATUS], isTerminator = 1 in
431+
def sublw_cc : SUBLW<0, PIC16Subcc>;
430432

431433
// Call instruction.
432434
let isCall = 1,

0 commit comments

Comments
 (0)