[SLC] Fix pointer diff type in sprintf() optimization
authorNikita Popov <npopov@redhat.com>
Tue, 25 Jan 2022 14:20:32 +0000 (15:20 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 25 Jan 2022 14:22:56 +0000 (15:22 +0100)
commit98db33349bcc4d12a56313c406c1f40038258f10
treeed8e8fd36c1910a58d69e977e18f44f07772d172
parent2c8a77ab21ff3a41829a5d67e0b838cc7a9f5f21
[SLC] Fix pointer diff type in sprintf() optimization

We should always be calculating a byte-wise difference here.
Previously this calculated the pointer difference while taking
the pointer element type into account, which is incorrect.
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/stpcpy-1.ll