diff options
author | Craig Topper <craig.topper@intel.com> | 2018-01-07 07:51:36 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-01-07 07:51:36 +0000 |
commit | d461aefe5fa2cf54b031293ce1fac667a1e7d968 (patch) | |
tree | 89b3854457f88fe44a1a7b3388c347efbc9f9106 /llvm/test/Transforms/FunctionAttrs | |
parent | a21f5511090ba214cb91d9ff8df82c08faddc968 (diff) | |
download | bcm5719-llvm-d461aefe5fa2cf54b031293ce1fac667a1e7d968.tar.gz bcm5719-llvm-d461aefe5fa2cf54b031293ce1fac667a1e7d968.zip |
[PowerPC] Add an ISD::TRUNCATE to the legalization for ppc_is_decremented_ctr_nonzero
Summary:
I believe legalization is really expecting that ReplaceNodeResults will return something with the same type as the thing that's being legalized. Ultimately, it uses the output to replace the uses in the DAG so the type should match to make that work.
There are two relevant cases here. When crbits are enabled, then i1 is a legal type and getSetCCResultType should return i1. In this case, the truncate will be between i1 and i1 and should be removed (SelectionDAG::getNode does this). Otherwise, getSetCCResultType will be i32 and the legalizer will promote the truncate to be i32 -> i32 which will be similarly removed.
With this fixed we can remove some code from PromoteIntRes_SETCC that seemed to only exist to deal with the intrinsic being replaced with a larger type without changing the other operand. With the truncate being used for connectivity this doesn't happen anymore.
Reviewers: hfinkel
Reviewed By: hfinkel
Subscribers: nemanjai, llvm-commits, kbarton
Differential Revision: https://reviews.llvm.org/D41654
llvm-svn: 321959
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs')
0 files changed, 0 insertions, 0 deletions