[PATCH] D83569: [PowerPC] Fix the killed flag in mi-peephole pass

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 21:30:05 PDT 2020


shchenz added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1562
+    SrcMI->getOperand(1).setIsKill(false);
+  }
+
----------------
ZhangKang wrote:
> shchenz wrote:
> > Should we also consider `SrcMI->getOperand(0)` or legacy `MI.getOperand(1)`  at least when MI and and SrcMI are in same BB?
> > 
> > We have a API `fixupIsDeadOrKill` for kill/dead flag fixup.
> The `SrcMI` will be removed if it's necessary in the line 1571. 
> 
> The `fixupIsDeadOrkill` is used for non-ssa, but the pass is a SSA pass. So, we can't using it.
The function `fixupIsDeadOrkill` should be extended to non-ssa in patch https://reviews.llvm.org/D81723.

If you want to completely fix up the kill/dead flag, there are some situations need to be considered, like:
1: 
```
    %2:g8rc = RLDICL %1, 0, 32
    STORE killed %1
    %3:g8rc = RLDICR %2, 2, 61   ;; killed flag from above STORE should be sunk down here
```
2:
```
    %2:g8rc = RLDICL killed %1, 0, 32
   STORE  %2
    %3:g8rc = RLDICR killed %2, 2, 61 ;;  killed flag for %2 should be hoisted up to above STORE
```

`fixupIsDeadOrkill` can do this for you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83569/new/

https://reviews.llvm.org/D83569





More information about the llvm-commits mailing list