[PATCH] D11044: [ImplicitNullChecks] Be smarter in picking the memory op.

Sanjoy Das sanjoy at playingwithpointers.com
Wed Jul 8 14:34:55 PDT 2015


sanjoy created this revision.
sanjoy added reviewers: atrick, JosephTremoulet, reames.
sanjoy added a subscriber: llvm-commits.

Before this change ImplicitNullChecks would only pick loads of the form:

```
   test Reg, Reg
   jz elsewhere
 fallthrough:
   movl 32(Reg), Reg2
```

but not (say)

```
   test Reg, Reg
   jz elsewhere
 fallthrough:
   inc Reg3
   movl 32(Reg), Reg2
```

This change teaches ImplicitNullChecks to look through "unrelated"
instructions like `inc Reg3` when searching for a load instruction
to convert to a trapping load.

http://reviews.llvm.org/D11044

Files:
  lib/CodeGen/ImplicitNullChecks.cpp
  test/CodeGen/X86/implicit-null-check-negative.ll
  test/CodeGen/X86/implicit-null-check.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11044.29288.patch
Type: text/x-patch
Size: 7874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150708/34860b58/attachment.bin>


More information about the llvm-commits mailing list