Removes redundant strlen call since str(n)cmp does it too.
Diff Detail
Event Timeline
lib/Transforms/Utils/SimplifyLibCalls.cpp | ||
---|---|---|
391 | Maybe I should extract this matching code for "strlen(x)+ 1" to helper static function now? Or later in followup folds? |
lib/Transforms/Utils/SimplifyLibCalls.cpp | ||
---|---|---|
391 | It would be clearer to reorganize this. I think "Length" is uninitialized along the "else" path? Or am I missing something? | |
405 | It's not enough to check that the Strlen is a call to strlen; you also have to prove the memory isn't modified between the strlen call and the strncmp call. |
lib/Transforms/Utils/SimplifyLibCalls.cpp | ||
---|---|---|
405 | Ah yes! I forget about it. :( I believe such analysis is not worth to do for this pattern. Closing.. |
Maybe I should extract this matching code for "strlen(x)+ 1" to helper static function now? Or later in followup folds?