summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2016-03-26 23:32:57 +0000
committerMichael Kruse <llvm@meinersbur.de>2016-03-26 23:32:57 +0000
commitff379b69b2f82c9ca9b955b0458bb1aba85b9b85 (patch)
treea97fa4b07963885e08e501d48ef4260d4ff549ba /clang/lib/CodeGen/CodeGenModule.cpp
parent796db35f622d0730347a09a9b675bc5e113db9c3 (diff)
downloadbcm5719-llvm-ff379b69b2f82c9ca9b955b0458bb1aba85b9b85.tar.gz
bcm5719-llvm-ff379b69b2f82c9ca9b955b0458bb1aba85b9b85.zip
[Verifier] Reject PHIs using defs from own block.
Reject the following IR as malformed (assuming that %entry, %next are not in a loop): next: %y = phi i32 [ 0, %entry ] %x = phi i32 [ %y, %entry ] Such PHI nodes came up in PR26718. While there was no consensus on whether or not this is valid IR, most opinions on that bug and in a discussion on the llvm-dev mailing list tended towards a "strict interpretation" (term by Joseph Tremoulet) of PHI node uses. Also, the language reference explicitly states that "the use of each incoming value is deemed to occur on the edge from the corresponding predecessor block to the current block" and `DominatorTree::dominates(Instruction*, Use&)` uses this definition as well. For the code mentioned in PR15384, clang does not compile to such PHIs (anymore?). The test case still hangs when replacing `%tmp6` with `%tmp` in revisions before r176366 (where PR15384 has been fixed). The occurrence of %tmp6 therefore was probably unintentional. Its value is not used except in other PHIs. Reviewers: majnemer, reames, JosephTremoulet, bkramer, grosser, jdoerfert, kparzysz, sanjoy Differential Revision: http://reviews.llvm.org/D18443 llvm-svn: 264528
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud