[ImplicitNullCheck] Handle instructions that preserve zero value
authorAnna Thomas <anna@azul.com>
Thu, 10 Sep 2020 17:14:44 +0000 (13:14 -0400)
committerAnna Thomas <anna@azul.com>
Thu, 10 Sep 2020 17:39:50 +0000 (13:39 -0400)
commit46329f6079da99133eab7942e79226b2afb40e75
tree3a0e3131143285dd41cfdbeecabb27fe38cd1548
parentb85c085c846c2cb5d24812555847846877ca13cb
[ImplicitNullCheck] Handle instructions that preserve zero value

This is the first in a series of patches to make implicit null checks
more general. This patch identifies instructions that preserves zero
value of a register and considers that as a valid instruction to hoist
along with the faulting load. See added testcases.

Reviewed-By: reames, dantrushin
Differential Revision: https://reviews.llvm.org/D87108
llvm/include/llvm/CodeGen/TargetInstrInfo.h
llvm/lib/CodeGen/ImplicitNullChecks.cpp
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/lib/Target/X86/X86InstrInfo.h
llvm/test/CodeGen/X86/implicit-null-check-negative.ll
llvm/test/CodeGen/X86/implicit-null-check.ll