[ARM] Fix non-determenistic behaviour
authorDiogo Sampaio <diogo.sampaio@arm.com>
Thu, 6 Feb 2020 08:54:30 +0000 (08:54 +0000)
committerDiogo Sampaio <diogo.sampaio@arm.com>
Thu, 6 Feb 2020 09:21:13 +0000 (09:21 +0000)
commit8ba2b6281075c65c1a47abed57810e1201942533
treea98323e2e9aea46bf1b18d39fdb4d6e6fa9dede6
parentb093b663707afccefef204d85fc37a95c6ac4ddf
[ARM] Fix non-determenistic behaviour

Summary:
ARM Type Promotion pass does not clear
the container that defines if one variable
was visited or not, missing optimization
opportunities by luck when two llvm:Values
from different functions  are allocated at
the same memory address.

Also fixes a comment and uses existing
method to pop and obtain last element
of the worklist.

Reviewers: samparker

Reviewed By: samparker

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73970
llvm/lib/CodeGen/TypePromotion.cpp