[PATCH] D55408: [PowerPC] Fix assert from machine verify pass that missing undef register flag

Zixuan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 6 20:54:10 PST 2018


wuzish created this revision.
wuzish added reviewers: nemanjai, jsji, hfinkel.
Herald added subscribers: kbarton, hiraditya, eraman, qcolombet.

Fix assert about using an undefined physical register in machine instruction verify pass. Following is the error info. The reason is that register flag `undef` is missing when doing transformation from If Conversion Pass.

llc -verify-machineinstrs llvm/test/CodeGen/PowerPC/zero-not-run.ll

  Bad machine code: Using an undefined physical register 
  - function:    func_65
  - basic block: %bb.0 entry (0x10024740738)
  - instruction: BCLR killed $cr5lt, implicit $lr8, implicit $rm, implicit undef $x3
  - operand 0:   killed $cr5lt
  LLVM ERROR: Found 1 machine code errors.

There are other existing testcases that can show similar issues too. So I add -verify-machineinstrs option to open verifying.

@hfinkel could you please have a look since the last change is related to your part.


Repository:
  rL LLVM

https://reviews.llvm.org/D55408

Files:
  llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
  llvm/test/CodeGen/PowerPC/aantidep-inline-asm-use.ll
  llvm/test/CodeGen/PowerPC/cr-spills.ll
  llvm/test/CodeGen/PowerPC/ctr-cleanup.ll
  llvm/test/CodeGen/PowerPC/ctrloop-large-ec.ll
  llvm/test/CodeGen/PowerPC/ctrloop-udivti3.ll
  llvm/test/CodeGen/PowerPC/early-ret2.ll
  llvm/test/CodeGen/PowerPC/ifcvt-forked-bug-2016-08-08.ll
  llvm/test/CodeGen/PowerPC/merge-st-chain-op.ll
  llvm/test/CodeGen/PowerPC/negctr.ll
  llvm/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll
  llvm/test/CodeGen/PowerPC/ppc-vaarg-agg.ll
  llvm/test/CodeGen/PowerPC/pr16556.ll
  llvm/test/CodeGen/PowerPC/pr25157-peephole.ll
  llvm/test/CodeGen/PowerPC/pr25157.ll
  llvm/test/CodeGen/PowerPC/stwu-sched.ll
  llvm/test/CodeGen/PowerPC/stwux.ll
  llvm/test/CodeGen/PowerPC/vsel-prom.ll
  llvm/test/CodeGen/PowerPC/vsx-fma-mutate-undef.ll
  llvm/test/CodeGen/PowerPC/xray-ret-is-terminator.ll
  llvm/test/CodeGen/PowerPC/xvcmpeqdp-v2f64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55408.177107.patch
Type: text/x-patch
Size: 14897 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/03dead60/attachment.bin>


More information about the llvm-commits mailing list