[PATCH] D113001: [NVPTX] Copy machine operand flags in TII::insertBranch

Andrew Savonichev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 04:13:50 PDT 2021


asavonic created this revision.
asavonic added reviewers: tra, jlebar, jholewinski.
Herald added a subscriber: hiraditya.
asavonic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Before this patch, flags such as undef were dropped by TII::insertBranch 
(used by BranchFolding pass), resulting in the following error from 
machine verifier:

  - Bad machine code: Reading virtual register without a def ***
- function:    hoge
- basic block: %bb.0 bb (0x562e9c240e68)
- instruction: CBranch %2:int1regs, %bb.3          // <--- no undef flag
- operand 0:   %2:int1regs


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113001

Files:
  llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp
  llvm/test/CodeGen/NVPTX/branch-fold.ll
  llvm/test/CodeGen/NVPTX/branch-fold.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113001.384030.patch
Type: text/x-patch
Size: 4234 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211102/ba344e2a/attachment.bin>


More information about the llvm-commits mailing list