[PATCH] D75014: [InstrEmitter, SystemZ] Copy Access registers with the correct register class.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 16:09:58 PST 2020


jonpa updated this revision to Diff 246851.
jonpa added a comment.
Herald added a subscriber: mgorny.

> ... That said, if we do need to handle this problem in target code, it might actually be cleaner to just do it as a separate PreReload pass that simply looks at COPY nodes and constrains source/target virtual registers if required. This could be something like the X86 FlagsCopyLowering pass, I guess (but much simpler).

Handling this with a new pre-regalloc pass instead that transforms COPY instructions of special physregs before register allocation. An alternative to this would be to do this in EmitInstrWithCustomInserter(), but currently COPY instructions are not handled there.

- It seems safest to build the target instructions compared to just constrain the virtual register class of the register of the COPY.
- I don't think kill flags are useful to manage here, so they are ignored.

> (Talking about flags, it seems that COPY from/to the %cc register would also require the same handling as access registers. Well, I guess we could implement a copy *to* %cc from a high register using TMHH, but we cannot implement a copy from %cc to a high register ...)

Handling also COPYs of CC. Copy *to* CC is now done either with TMLH or TMHH (depending on the source reg) in copyPhysReg(). A copy from CC is handled in this new pass instead.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75014/new/

https://reviews.llvm.org/D75014

Files:
  llvm/lib/Target/SystemZ/CMakeLists.txt
  llvm/lib/Target/SystemZ/SystemZ.h
  llvm/lib/Target/SystemZ/SystemZCopyPhysRegs.cpp
  llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
  llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
  llvm/test/CodeGen/SystemZ/tls-08.ll
  llvm/test/CodeGen/SystemZ/tls-09.ll
  llvm/test/CodeGen/SystemZ/tls-10.mir
  llvm/test/CodeGen/SystemZ/tls-11.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75014.246851.patch
Type: text/x-patch
Size: 11509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200227/96525436/attachment.bin>


More information about the llvm-commits mailing list