bpf: New optimization pass for eliminating unnecessary i32 promotions
authorYonghong Song <yhs@fb.com>
Fri, 23 Feb 2018 23:49:32 +0000 (23:49 +0000)
committerYonghong Song <yhs@fb.com>
Fri, 23 Feb 2018 23:49:32 +0000 (23:49 +0000)
commit60fed1fef0eaad1069aa49f147c3cd1b145381f6
tree863335141025f2090afae9c747aba13ec3a34099
parentae961bb06127330c6ee04c1c584271f66829d74e
bpf: New optimization pass for eliminating unnecessary i32 promotions

This pass performs peephole optimizations to cleanup ugly code sequences at
MachineInstruction layer.

Currently, the only optimization in this pass is to eliminate type
promotion
sequences for zero extending 32-bit subregisters to 64-bit registers.

If the compiler could prove the zero extended source come from 32-bit
subregistere then it is safe to erase those promotion sequece, because the
upper half of the underlying 64-bit registers were zeroed implicitly
already.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325991
llvm/lib/Target/BPF/BPF.h
llvm/lib/Target/BPF/BPFMIPeephole.cpp [new file with mode: 0644]
llvm/lib/Target/BPF/BPFTargetMachine.cpp
llvm/lib/Target/BPF/CMakeLists.txt