[all-commits] [llvm/llvm-project] f6515b: [PowerPC] Do not fold `cmp(d|w)` and `subf` instru...

bzEq via All-commits all-commits at lists.llvm.org
Sun Jan 3 23:54:31 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f6515b05205d4324d174dd1f7455c6c8e6671e6b
      https://github.com/llvm/llvm-project/commit/f6515b05205d4324d174dd1f7455c6c8e6671e6b
  Author: Kai Luo <lkail at cn.ibm.com>
  Date:   2021-01-04 (Mon, 04 Jan 2021)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
    M llvm/test/CodeGen/PowerPC/pr47830.ll

  Log Message:
  -----------
  [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




More information about the All-commits mailing list