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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 19 05:18:37 PST 2023


xbolva00 added a comment.

So maybe there is a real UB which is now exploited by stronger optimizations…



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:7135
+        return true;
+      // Return null to a nonnnull return value is undefined.
+      if (C->isNullValue() &&
----------------
if the result value is not used - is it?

check line 7172, it requires nonnnull+noundef for similar case.


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