llvm-project/llvm/lib/Target/PowerPC/MCTargetDesc
Ulrich Weigand 1931b01a64 [PowerPC] Remove incorrect use of COPY_TO_REGCLASS in fast isel
The fast isel pass currently emits a COPY_TO_REGCLASS node to convert
from a F4RC to a F8RC register class during conversion of a
floating-point number to integer. There is actually no support in the
common code instruction printers to emit COPY_TO_REGCLASS nodes, so the
PowerPC back-end has special code there to simply ignore
COPY_TO_REGCLASS.

This is correct *if and only if* the source and destination registers of
COPY_TO_REGCLASS are the same (except for the different register class).
But nothing guarantees this to be the case, and if the register
allocator does end up allocating source and destination to different
registers after all, the back-end simply generates incorrect code. I've
included a test case that shows such incorrect code generation.

However, it seems that COPY_TO_REGCLASS is actually not intended to be
used at the MI layer at all. It is used during SelectionDAG, but always
lowered to a plain COPY before emitting MI. Other back-end's fast isel
passes never emit COPY_TO_REGCLASS at all. I suspect it is simply wrong
for the PowerPC back-end to emit it here.

This patch changes the PowerPC back-end to directly emit COPY instead of
COPY_TO_REGCLASS and removes the special handling in the instruction
printers.

Differential Revision: http://reviews.llvm.org/D18605

llvm-svn: 265020
2016-03-31 14:44:50 +00:00
..
CMakeLists.txt
LLVMBuild.txt
PPCAsmBackend.cpp Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC. 2015-09-15 16:17:27 +00:00
PPCELFObjectWriter.cpp [MC] Merge VK_PPC_TPREL in to generic VK_TPREL. 2016-02-10 18:32:01 +00:00
PPCFixupKinds.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
PPCMCAsmInfo.cpp Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC. 2015-09-15 16:17:27 +00:00
PPCMCAsmInfo.h Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC. 2015-09-15 16:17:27 +00:00
PPCMCCodeEmitter.cpp [PowerPC] Remove incorrect use of COPY_TO_REGCLASS in fast isel 2016-03-31 14:44:50 +00:00
PPCMCExpr.cpp MC: Add target hook to control symbol quoting 2015-06-09 00:31:39 +00:00
PPCMCExpr.h Fix pr24486. 2015-10-05 12:07:05 +00:00
PPCMCTargetDesc.cpp Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC. 2015-09-15 16:17:27 +00:00
PPCMCTargetDesc.h Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC. 2015-09-15 16:17:27 +00:00
PPCMachObjectWriter.cpp WebAssembly: fix build break introduced by ELFObjectWriter churn 2016-01-13 23:36:00 +00:00
PPCPredicates.cpp
PPCPredicates.h [PowerPC] Add Branch Hints for Highly-Biased Branches 2015-12-12 00:32:00 +00:00