[PATCH] D144319: [SimplifyCFG] Check if the return instruction causes undefined behavior

DianQK via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 19 02:11:47 PST 2023


DianQK added a comment.

Another thing I'm curious about is why all the `gep zero` have been removed in the `llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll` file at the 8979ae42769e529b0f6fce3268492ffb49bd54b9 <https://github.com/llvm/llvm-project/commit/8979ae42769e529b0f6fce3268492ffb49bd54b9#diff-1ef9510bac94e9a0b139fc4adac4ca65b8687248f5691a7fae468eab2a396a1bL404>.

  -  %phi = phi i8* [ %Y, %entry ], [ null, %if ]
  -  %gep = getelementptr inbounds i8, i8* %phi, i64 0
  -  call i8* @fn_nonnull_noundef_arg(i8* %gep)
  +  %phi = phi ptr [ %Y, %entry ], [ null, %if ]
  +  call ptr @fn_nonnull_noundef_arg(ptr %phi)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144319



More information about the llvm-commits mailing list