[PATCH] D125114: [SimplifyLibCalls] handle subobjects of constant aggregates

Martin Sebor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 10:56:14 PDT 2022


msebor added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1182
+      // let sanitizers catch it.
+      return nullptr;
+
----------------
nikic wrote:
> I assume this is done to preserve some existing test behavior?
Yes, sort of: `memcmp-4.ll`, added in preparation for this change.


================
Comment at: llvm/test/Transforms/InstCombine/strlen-8.ll:40
 
 ; Fold strlen(&a5_4[2][I]) to i <= 1 ? 1 - I : 0.
 
----------------
nikic wrote:
> This is actually folding `strlen(&a5_4[2][1])` -- probably not intentional?
Yes, that's a typo, thanks!  None of the cases in this test is expected to be folded yet.  There's a `TODO: Handle subobjects` comment in `optimizeStringLength` but let me add a comment to the test too.  It might be helpful to start tracking these outstanding gaps more formally.


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

https://reviews.llvm.org/D125114



More information about the llvm-commits mailing list