SuccessChanges

Summary

  1. [VPlan] Make VPInstruction a VPDef (details)
  2. Fold comparison of __builtin_object_size expression with -1 for non-const size (details)
Commit c0c0ae16c3312578cd15fd9913aac3ce528b7602 by flo
[VPlan] Make VPInstruction a VPDef

This patch turns updates VPInstruction to manage the value it defines
using VPDef. The VPValue is used  during VPlan construction and
codegeneration instead of the plain IR reference where possible.

Reviewed By: gilr

Differential Revision: https://reviews.llvm.org/D90565
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.h
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/VPlanValue.h
Commit 6fcb039956483988fa4b82a9a3944084353d00a5 by sguelton
Fold comparison of __builtin_object_size expression with -1 for non-const size

When __builtin_dynamic_object_size returns a non-constant expression, it cannot
be -1 since that is an invalid return value for object size. However since
passes running after the substitution don't know this, they are unable to
optimize away the comparison and hence the comparison and branch stays in there.
This change generates an appropriate call to llvm.assume to help the optimizer
folding the test.

glibc is considering adopting __builtin_dynamic_object_size for additional
protection[1] and this change will help reduce branching overhead in fortified
implementations of all of the functions that don't have the __builtin___*_chk
type builtins, e.g. __ppoll_chk.

Also remove the test limit-max-iterations.ll because it was deemed unnecessary
during review.

[1] https://sourceware.org/pipermail/libc-alpha/2020-November/120191.html

Differential Revision: https://reviews.llvm.org/D93015
The file was modifiedllvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll
The file was removedllvm/test/Transforms/InstCombine/limit-max-iterations.ll
The file was modifiedllvm/lib/Analysis/MemoryBuiltins.cpp