llvm/lib
Chandler Carruth 6b980541df Refactor the interface to recursively simplifying instructions to be tad
bit simpler by handling a common case explicitly.

Also, refactor the implementation to use a worklist based walk of the
recursive users, rather than trying to use value handles to detect and
recover from RAUWs during the recursive descent. This fixes a very
subtle bug in the previous implementation where degenerate control flow
structures could cause mutually recursive instructions (PHI nodes) to
collapse in just such a way that From became equal to To after some
amount of recursion. At that point, we hit the inf-loop that the assert
at the top attempted to guard against. This problem is defined away when
not using value handles in this manner. There are lots of comments
claiming that the WeakVH will protect against just this sort of error,
but they're not accurate about the actual implementation of WeakVHs,
which do still track RAUWs.

I don't have any test case for the bug this fixes because it requires
running the recursive simplification on unreachable phi nodes. I've no
way to either run this or easily write an input that triggers it. It was
found when using instruction simplification inside the inliner when
running over the nightly test-suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153393 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-24 21:11:24 +00:00
..
Analysis Refactor the interface to recursively simplifying instructions to be tad 2012-03-24 21:11:24 +00:00
Archive Include cstdio in a few place that depended on getting it transitively through StringExtras.h 2012-03-23 11:35:30 +00:00
AsmParser Convert assert(0) to llvm_unreachable 2012-02-07 05:05:23 +00:00
Bitcode llvm::SwitchInst 2012-03-11 06:09:17 +00:00
CodeGen Add the ability to promote legal integer VAARGs. This is required for the PPC64 SVR4 ABI. 2012-03-24 03:53:52 +00:00
DebugInfo More dead code removal (using -Wunreachable-code) 2012-01-20 21:51:11 +00:00
ExecutionEngine Make it feasible for clients using EngineBuilder to capture the TargetMachine that is created as part of selecting the appropriate target. 2012-03-23 17:40:56 +00:00
Linker It's possible for two types, which are isomorphic, to be added to the 2012-03-23 23:17:38 +00:00
MC Add a hook in MCELFObjectTargetWriter to allow targets to sort relocation 2012-03-23 23:06:45 +00:00
Object [Object/COFF]: Expose getSectionContents. 2012-03-19 20:27:37 +00:00
Support [PathV2]: Fix bug in create_directories which caused infinite recursion on 2012-03-21 23:09:14 +00:00
TableGen Fix infinite loop in nested multiclasses. 2012-03-07 16:39:35 +00:00
Target Fix small-integer VAARG on SVR4 ABI PPC64. 2012-03-24 03:53:55 +00:00
Transforms Refactor the interface to recursively simplifying instructions to be tad 2012-03-24 21:11:24 +00:00
VMCore Remove always true variable. 2012-03-24 20:02:25 +00:00
CMakeLists.txt Move TableGen's parser and entry point into a library 2011-10-01 16:41:13 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Remove more of llvmc and dependencies. 2011-09-20 00:34:27 +00:00