llvm-project/llvm/unittests/CodeGen/GlobalISel
Dominik Montada 35950fea8d [GlobalISel] support narrow G_IMPLICIT_DEF for DstSize % NarrowSize != 0
Summary:
When narrowing G_IMPLICIT_DEF where the original size is not a multiple
of the narrow size, emit a smaller G_IMPLICIT_DEF and use G_ANYEXT.

To prevent a potential endless loop in the legalizer, the condition
to combine G_ANYEXT(G_IMPLICIT_DEF) is changed from isInstUnsupported
to !isInstLegal, since in this case the combine is only valid if
consequent legalization of the newly combined G_IMPLICIT_DEF does not
introduce G_ANYEXT due to narrowing.

Although this legalization for G_IMPLICIT_DEF would also be valid for
the general case, it actually caused a lot of code regressions when
tried due to superfluous COPYs and combines not getting hit anymore.

Reviewers: dsanders, aemerson, volkan, arsenm, aditya_nandakumar

Reviewed By: arsenm

Subscribers: jvesely, nhaehnle, kerbowa, wdng, rovka, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76598
2020-04-08 11:00:07 +02:00
..
CMakeLists.txt [Legalizer] Refactoring out legalizeMachineFunction 2019-12-13 15:45:18 -08:00
CSETest.cpp GlobalISel: Prepare to allow other target unit tests 2020-03-23 15:02:30 -04:00
ConstantFoldingTest.cpp GlobalISel: Prepare to allow other target unit tests 2020-03-23 15:02:30 -04:00
GISelMITest.cpp AMDGPU/GlobalISel: Implement computeNumSignBitsForTargetInstr 2020-03-23 15:02:30 -04:00
GISelMITest.h AMDGPU/GlobalISel: Implement computeNumSignBitsForTargetInstr 2020-03-23 15:02:30 -04:00
KnownBitsTest.cpp AMDGPU/GlobalISel: Implement computeNumSignBitsForTargetInstr 2020-03-23 15:02:30 -04:00
LegalizerHelperTest.cpp [GlobalISel] support narrow G_IMPLICIT_DEF for DstSize % NarrowSize != 0 2020-04-08 11:00:07 +02:00
LegalizerInfoTest.cpp GlobalISel: Introduce bitcast legalize action 2020-03-24 19:33:33 -04:00
LegalizerTest.cpp GlobalISel: Prepare to allow other target unit tests 2020-03-23 15:02:30 -04:00
MachineIRBuilderTest.cpp [Alignment][NFC] Use Align version of getMachineMemOperand 2020-03-30 15:46:27 +00:00
PatternMatchTest.cpp GlobalISel: Add matcher for G_SHL 2020-03-29 14:03:07 -04:00