[PATCH] [PowerPC] Support select-cc for VSX

Bill Schmidt wschmidt at linux.vnet.ibm.com
Tue Oct 21 11:43:08 PDT 2014


Hi hfinkel, seurer,

The tests test/CodeGen/Generic/select-cc.ll and test/CodeGen/PowerPC/select-cc.ll both fail with VSX enabled.  The problem is that the lowering logic for the SELECT and SELECT_CC operations doesn't currently support the VSX registers.	 This patch fixes that.

In lib/Target/PowerPC/PPCInstrInfo.td, we have pseudos to handle this for other register classes.  Similar pseudos are added in PPCInstrVSX.td (they must be there, because the "vsrc" register class
definition appears there) for the VSRC register class. 	The SELECT_VSRC pseudo is then used	in pattern matching for SELECT_CC.

The rest of the patch just adds logic for SELECT_VSRC wherever similar logic appears for SELECT_VRRC.

There are no new test cases because the existing tests above test this, along with a variant in test/CodeGen/PowerPC/vsx.ll.

One question is	whether we want to add similar code for the VSFRC register class.  We currently have _F8 variants of these pseudos to support the f64 type.  We could	add _VSFRC variants that override these in PPCInstrVSX.td.  It's not a priori clear to me whether this would be helpful; there	may be random effects of introducing copies between the F8RC and VFRC registers, but obviously the benefit is to allow RA to use all 64 scalar float regs.  Thoughts?

http://reviews.llvm.org/D5886

Files:
  lib/Target/PowerPC/PPCISelDAGToDAG.cpp
  lib/Target/PowerPC/PPCISelLowering.cpp
  lib/Target/PowerPC/PPCInstrVSX.td
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5886.15197.patch
Type: text/x-patch
Size: 4644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141021/718359f7/attachment.bin>


More information about the llvm-commits mailing list