forked from OSchip/llvm-project
4e533ef7a9
SCEV expansion can invalidate previously expanded values. For example in SCEVExpander::ReuseOrCreateCast, if we already have the requested cast value but it's not at the desired location, a new cast is inserted and the old cast will be invalidated. Therefore, when expanding the bounds for the pointers, a later entry can invalidate the IR value for an earlier one. The fix is to store a value handle rather than the value itself. The newly added test has a more detailed description of how the bug triggers. This bug can have a negative but potentially highly variable performance impact in Loop Distribution. Because one of the bound values was invalidated and is an undef expression now, InstCombine is free to transform the array overlap check: Start0 <= End1 && Start1 <= End0 into: Start0 <= End1 So depending on the runtime location of the arrays, we would detect a conflict and fall back on the original loop of the versioned loop. Also tested compile time with SPEC2006 LTO bc files. llvm-svn: 245760 |
||
---|---|---|
.. | ||
basic-with-memchecks.ll | ||
basic.ll | ||
bounds-expansion-bug.ll | ||
crash-in-memcheck-generation.ll | ||
no-if-convert.ll | ||
outside-use.ll | ||
program-order.ll | ||
unknown-bounds-for-memchecks.ll |