llvm-6502/lib
Matt Wala 106d75d396 [Scalarizer] Fix potential for stale data in Scattered across invocations
Summary:
Scalarizer has two data structures that hold information about changes
to the function, Gathered and Scattered. These are cleared in finish()
at the end of runOnFunction() if finish() detects any changes to the
function.

However, finish() was checking for changes by only checking if
Gathered was non-empty. The function visitStore() only modifies
Scattered without touching Gathered. As a result, Scattered could have
ended up having stale data if Scalarizer only scalarized store
instructions. Since the data in Scattered is used during the execution
of the pass, this introduced dangling pointer errors.

The fix is to check whether both Scattered and Gathered are empty
before deciding what to do in finish(). This also fixes a problem
where the Function can be modified although the pass returns false.

Reviewers: rnk

Subscribers: rnk, srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D10459

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243040 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 20:53:46 +00:00
..
Analysis [GMR] Switch the function info we store for every function to be a much 2015-07-23 07:50:52 +00:00
AsmParser AsmParser: Add a function to parse a standalone constant value. 2015-07-17 22:07:03 +00:00
Bitcode
CodeGen [PeepholeOptimizer] Refactor optimizeUncoalescable logic 2015-07-22 21:30:16 +00:00
DebugInfo
ExecutionEngine Fix -Wextra-semi warnings. 2015-07-22 20:46:11 +00:00
Fuzzer [libFuzzer] dump long running units to disk 2015-07-23 18:37:22 +00:00
IR Fix -Wextra-semi warnings. 2015-07-22 20:46:11 +00:00
IRReader
LibDriver Add support for producing thin archives in llvm-lib. 2015-07-17 16:01:11 +00:00
LineEditor
Linker
LTO
MC Fix a -Winconsistent-missing-override failure in the .intel_syntax 2015-07-22 11:22:29 +00:00
Object Fix fetching the symbol table of a thin archive. 2015-07-22 19:34:26 +00:00
Option
Passes
ProfileData
Support Remove unnecessary in C++11 c_str() calls 2015-07-23 05:49:29 +00:00
TableGen
Target X86: Use dyn_cast instead of isa+cast, NFC 2015-07-23 19:27:07 +00:00
Transforms [Scalarizer] Fix potential for stale data in Scattered across invocations 2015-07-23 20:53:46 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile