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

Martin Sebor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 15:48:33 PDT 2022


msebor added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4242
+      ;
+    else {
       Slice.Array = nullptr;
----------------
nikic wrote:
> I don't really get the purpose of this special case. InstCombine tests pass for me if I drop the `if()` part and always go into the `else` branch.
The code predates this change (see line 4217).  The only difference dropping the `if` has on trunk is on the assertion in `wcslen-3.ll:192` which has this comment:
```
; This could in principle be simplified, but the current implementation bails on
; type mismatches.
```
This patch simplifies the emitted code as noted in the comment (and adjusts the test) so it doesn't seem like the special case ever served a good purpose and can be removed.


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

https://reviews.llvm.org/D125114



More information about the llvm-commits mailing list