[PATCH] D67233: InstCombine: Fix crash on icmp of gep with addrspacecasted null

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 11:42:42 PDT 2019


arsenm marked an inline comment as done.
arsenm added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:908
       !NullPointerIsDefined(I.getFunction(),
                             RHS->getType()->getPointerAddressSpace())) {
     // For most address spaces, an allocation can't be placed at null, but null
----------------
jdoerfert wrote:
> Why doesn't the `NullPointerIsDefined` check catch this and prevent the transformation in the first place?
> 
Because this is valid. This stripped off the addrspacecast and sees this is a cast from the invalid null in addrspace 0. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67233/new/

https://reviews.llvm.org/D67233





More information about the llvm-commits mailing list