SuccessChanges

Summary

  1. [PowerPC] Do not fold `cmp(d|w)` and `subf` instruction to `subf.` if `nsw` is not present (details)
Commit f6515b05205d4324d174dd1f7455c6c8e6671e6b by lkail
[PowerPC] Do not fold `cmp(d|w)` and `subf` instruction to `subf.` if `nsw` is not present

In `PPCInstrInfo::optimizeCompareInstr` we seek opportunities to fold `cmp(d|w)` and `subf` as an `subf.`. However, if `subf.` gets overflow, `cr0` can't reflect the correct order, violating the semantics of `cmp(d|w)`.

Fixed https://bugs.llvm.org/show_bug.cgi?id=47830.

Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D90156
The file was modifiedllvm/test/CodeGen/PowerPC/pr47830.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.cpp