[PPC64] Mark CR0 Live if PPCInstrInfo::optimizeCompareInstr Creates a Use of CR0
authorChuang-Yu Cheng <cycheng@multicorewareinc.com>
Tue, 12 Apr 2016 03:10:52 +0000 (03:10 +0000)
committerChuang-Yu Cheng <cycheng@multicorewareinc.com>
Tue, 12 Apr 2016 03:10:52 +0000 (03:10 +0000)
commit94f58e79aebff75f955f888f223cc2d507c41f20
tree42dc614abd028fd1488703c41db7a125088e9605
parentc066d9cf55686a1fff5b7fe1bd1b77bdac6dca54
[PPC64] Mark CR0 Live if PPCInstrInfo::optimizeCompareInstr Creates a Use of CR0

Resolve Bug 27046 (https://llvm.org/bugs/show_bug.cgi?id=27046).
The PPCInstrInfo::optimizeCompareInstr function could create a new use of
CR0, even if CR0 were previously dead. This patch marks CR0 live if a use of
CR0 is created.

Author: Tom Jablin (tjablin)
Reviewers: hfinkel kbarton cycheng

http://reviews.llvm.org/D18884

llvm-svn: 266040
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
llvm/test/CodeGen/PowerPC/opt-cmp-inst-cr0-live.ll [new file with mode: 0644]