[PATCH] D136524: [InstCombine] Handle select inst when eliminating constant memcpy
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 19 07:36:07 PST 2023
nikic added inline comments.
================
Comment at: llvm/test/Transforms/InstCombine/ptr-replace-alloca.ll:349
+ %alloca = alloca [32 x i8]
+ call void @llvm.memcpy.p0.p0.i64(ptr %alloca, ptr @g1, i64 256, i1 false)
+ %ptr = select i1 %cond, ptr %alloca, ptr %p
----------------
All of these 256 should be 32 instead.
================
Comment at: llvm/test/Transforms/InstCombine/ptr-replace-alloca.ll:397-399
+ %ptr = select i1 %cond, ptr %alloca, ptr %p
+ %val = getelementptr inbounds [32 x i8], ptr %alloca, i32 0, i32 2
+ %load = load i8, ptr %val
----------------
Otherwise the select is simply unused, and this doesn't show the desired transform.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136524/new/
https://reviews.llvm.org/D136524
More information about the llvm-commits
mailing list