[all-commits] [llvm/llvm-project] b91d9e: [GlobalISel]: Fix some non determinism exposed in ...
proaditya via All-commits
all-commits at lists.llvm.org
Tue Feb 18 14:55:08 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: b91d9ec0bb8caedcdd1ddf0506fc19d6c55efae3
https://github.com/llvm/llvm-project/commit/b91d9ec0bb8caedcdd1ddf0506fc19d6c55efae3
Author: Aditya Nandakumar <aditya_nandakumar at apple.com>
Date: 2020-02-18 (Tue, 18 Feb 2020)
Changed paths:
M llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
M llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
M llvm/include/llvm/CodeGen/MachineFunction.h
M llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp
M llvm/lib/CodeGen/GlobalISel/GISelChangeObserver.cpp
M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
M llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
M llvm/lib/CodeGen/GlobalISel/Utils.cpp
Log Message:
-----------
[GlobalISel]: Fix some non determinism exposed in CSE due to not notifying observers about mutations + add verification for CSE
https://reviews.llvm.org/D67133
While investigating some non determinism (CSE doesn't produce wrong
code, it just doesn't CSE some times) in GISel CSE on an out of tree
target, I realized that the core issue was that there were lots of code
that mutates (setReg, setRegClass etc), but doesn't notify observers
(CSE in this case but this could be any other observer). In order to
make the Observer be available in various parts of code and to avoid
having to thread it through various API, the MachineFunction now has the
observer as field. This allows it to be easily used in helper functions
such as constrainOperandRegClass.
Also added some invariant verification method in CSEInfo which can
catch these issues (when CSE is enabled).
More information about the All-commits
mailing list