Skip to content

Commit bc76dad

Browse files
committed
[CodeGen] Move ARMCodegenPrepare to TypePromotion
Convert ARMCodeGenPrepare into a generic type promotion pass by: - Removing the insertion of arm specific intrinsics to handle narrow types as we weren't using this. - Removing ARMSubtarget references. - Now query a generic TLI object to know which types should be promoted and what they should be promoted to. - Move all codegen tests into Transforms folder and testing using opt and not llc, which is how they should have been written in the first place... The pass searches up from icmp operands in an attempt to safely promote types so we can avoid generating unnecessary unsigned extends during DAG ISel. Differential Revision: https://reviews.llvm.org/D69556
1 parent 6713670 commit bc76dad

31 files changed

+3454
-4053
lines changed

llvm/include/llvm/CodeGen/Passes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ namespace llvm {
463463
/// Create Hardware Loop pass. \see HardwareLoops.cpp
464464
FunctionPass *createHardwareLoopsPass();
465465

466+
/// Create IR Type Promotion pass. \see TypePromotion.cpp
467+
FunctionPass *createTypePromotionPass();
468+
466469
} // End llvm namespace
467470

468471
#endif

llvm/include/llvm/InitializePasses.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ void initializeTargetTransformInfoWrapperPassPass(PassRegistry&);
408408
void initializeThreadSanitizerLegacyPassPass(PassRegistry&);
409409
void initializeTwoAddressInstructionPassPass(PassRegistry&);
410410
void initializeTypeBasedAAWrapperPassPass(PassRegistry&);
411+
void initializeTypePromotionPass(PassRegistry&);
411412
void initializeUnifyFunctionExitNodesPass(PassRegistry&);
412413
void initializeUnpackMachineBundlesPass(PassRegistry&);
413414
void initializeUnreachableBlockElimLegacyPassPass(PassRegistry&);

llvm/lib/CodeGen/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ add_llvm_component_library(LLVMCodeGen
163163
TargetRegisterInfo.cpp
164164
TargetSchedule.cpp
165165
TargetSubtargetInfo.cpp
166+
TypePromotion.cpp
166167
TwoAddressInstructionPass.cpp
167168
UnreachableBlockElim.cpp
168169
ValueTypes.cpp

llvm/lib/CodeGen/CodeGen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
105105
initializeTailDuplicatePass(Registry);
106106
initializeTargetPassConfigPass(Registry);
107107
initializeTwoAddressInstructionPassPass(Registry);
108+
initializeTypePromotionPass(Registry);
108109
initializeUnpackMachineBundlesPass(Registry);
109110
initializeUnreachableBlockElimLegacyPassPass(Registry);
110111
initializeUnreachableMachineBlockElimPass(Registry);

0 commit comments

Comments
 (0)