llvm-project/llvm/test/CodeGen
Max Kazantsev e8e01143ec [ImplicitNullChecks] Check for rewrite of register used in 'test' instruction
The following code pattern:

       mov %rax, %rcx
       test %rax, %rax
       %rax = ....
       je  throw_npe
       mov(%rcx), %r9
       mov(%rax), %r10

gets transformed into the following incorrect code after implicit null check pass:
        mov %rax, %rcx
       %rax = ....
       faulting_load_op("movl (%rax), %r10", throw_npe)
       mov(%rcx), %r9

For implicit null check pass, if the register that is checked for null value (ie, the register used in the 'test' instruction) is written into before the condition jump, we should avoid doing the optimization.

Patch by Surya Kumari Jangala!

Differential Revision: https://reviews.llvm.org/D48627
Reviewed By: skatkov

llvm-svn: 336241
2018-07-04 08:01:26 +00:00
..
AArch64 [AArch64][GlobalISel] Fix fallbacks introduced in r336120 due to unselectable stores. 2018-07-03 15:59:26 +00:00
AMDGPU AMDGPU/GlobalISel: Make IMPLICIT_DEF of all sizes < 512 legal. 2018-06-30 04:09:44 +00:00
ARC
ARM [ARM] Fix PR37382: Don't optimize mul.with.overflow on thumbv6m. 2018-07-02 21:05:26 +00:00
AVR [AVR] Set trackLivenessAfterRegAlloc 2018-06-11 14:46:48 +00:00
BPF [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
Generic Implement strip.invariant.group 2018-07-02 04:49:30 +00:00
Hexagon [DAGCombiner] Ensure we use the correct CC result type in visitSDIV (REAPPLIED) 2018-06-28 17:33:41 +00:00
Inputs
Lanai Remove SETCCE use from Lanai's backend 2018-06-03 12:56:24 +00:00
MIR [DebugInfo] Make sure all DBG_VALUEs' reguse operands have IsDebug property 2018-06-21 10:03:34 +00:00
MSP430 Emit a left-shift instead of a power-of-two multiply for jump-tables 2018-05-16 08:58:26 +00:00
Mips [MIPS GlobalISel] Lower arguments using stack 2018-07-03 09:31:48 +00:00
NVPTX [NVPTX] Expand v2f16 INSERT_VECTOR_ELT 2018-07-03 20:40:04 +00:00
Nios2
PowerPC [PowerPC] Don't make it as pre-inc candidate if displacement isn't 4's multiple for i64 pre-inc load/store 2018-07-02 05:46:09 +00:00
RISCV [RISCV] Add machine function pass to merge base + offset 2018-06-27 20:51:42 +00:00
SPARC [Sparc] Add support for 13-bit PIC 2018-06-11 05:50:08 +00:00
SystemZ Recommit r335333 "[MC] - Add .stack_size sections into groups and link them with .text" 2018-06-22 10:53:47 +00:00
Thumb [ARM] Testcase for Thumb1 cmp with constants. 2018-06-19 00:12:13 +00:00
Thumb2 Generalize MergeBlockIntoPredecessor. Replace uses of MergeBasicBlockIntoOnlyPred. 2018-06-20 22:01:04 +00:00
WebAssembly [WebAssembly] Support for atomic stores 2018-07-02 21:22:59 +00:00
WinCFGuard
WinEH [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
X86 [ImplicitNullChecks] Check for rewrite of register used in 'test' instruction 2018-07-04 08:01:26 +00:00
XCore [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00