[AggressiveInstCombine] Fold strcmp for short string literals
authorMaksim Kita <kitaetoya@gmail.com>
Wed, 19 Jul 2023 15:07:40 +0000 (17:07 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 19 Jul 2023 15:12:27 +0000 (17:12 +0200)
commit8981520b19f2d2fe3d2bc80cf26318ee6b5b7473
treecda96a55ba4b90ee38d3ef0aba89f85a01224e8f
parente537c839757c6bae91bd5adbf65eb4e06a040840
[AggressiveInstCombine] Fold strcmp for short string literals

Fold strcmp() against 1-char string literals.

This designates AggressiveInstCombine as the pass for libcalls
simplifications that may need to change the control flow graph.

Fixes https://github.com/llvm/llvm-project/issues/58003.

Differential Revision: https://reviews.llvm.org/D154725
llvm/include/llvm/Analysis/ValueTracking.h
llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/AggressiveInstCombine/strcmp.ll