[PATCH] D130919: [MRI] isConstantPhysReg should also check if the register is clobbered by a RegMask

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 11:00:51 PDT 2022


Carrot created this revision.
Carrot added reviewers: gberry, arsenm.
Herald added subscribers: kosarev, foad, kerbowa, pengfei, tpr, atanasyan, jrtc27, hiraditya, nhaehnle, jvesely, sdardis, qcolombet, MatzeB.
Herald added a project: All.
Carrot requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Current implementation of MachineRegisterInfo::isConstantPhysReg checks if the specified physical is modified in a function, but it only checks if it is used in a Def register operand, it may still be modified in a RegMask operand, like a function call. So it can give wrong result in this situation.

Other changes are used to prevent test regressions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130919

Files:
  llvm/include/llvm/CodeGen/MachineRegisterInfo.h
  llvm/lib/CodeGen/MachineRegisterInfo.cpp
  llvm/lib/CodeGen/RegisterCoalescer.cpp
  llvm/lib/CodeGen/TargetInstrInfo.cpp
  llvm/lib/Target/AMDGPU/SIPreAllocateWWMRegs.cpp
  llvm/lib/Target/Mips/MipsRegisterInfo.cpp
  llvm/lib/Target/Mips/MipsRegisterInfo.h
  llvm/lib/Target/X86/X86InstrInfo.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130919.449070.patch
Type: text/x-patch
Size: 4963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220801/7ea683a7/attachment.bin>


More information about the llvm-commits mailing list