skachkov-sc wrote: I think we should also check this optimization for non-byte stores, e.g. ``` define i32 @f(ptr %ptr) %ptr1 = getelementptr inbounds i8, ptr %ptr, i64 2 store i16 0, ptr %ptr, align 2 store i16 0, ptr %ptr1, align 2 %L = load i32, ptr %ptr, align 4 ``` GVN should optimize the case when 1-byte load location is fully covered with 2-byte store and extract the required byte from stored value, but it's good to check if reconstruction of 4-byte %L can be simplified after.
https://github.com/llvm/llvm-project/pull/72364 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits