Page MenuHomePhabricator

[PowerPC] Do not fold `cmp(d|w)` and `subf` instruction to `subf.` if `nsw` is not present
Needs ReviewPublic

Authored by lkail on Oct 26 2020, 7:15 AM.

Details

Reviewers
nemanjai
Group Reviewers
Restricted Project
Summary

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.

Diff Detail