[all-commits] [llvm/llvm-project] 8f997b: [GC] Loosen ordering on statepoint reloads to allo...
Philip Reames via All-commits
all-commits at lists.llvm.org
Wed Mar 11 12:30:10 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 8f997b4f0118a8f9cd5c1071b61bfbc35a7e7e85
https://github.com/llvm/llvm-project/commit/8f997b4f0118a8f9cd5c1071b61bfbc35a7e7e85
Author: Philip Reames <listmail at philipreames.com>
Date: 2020-03-11 (Wed, 11 Mar 2020)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
M llvm/test/CodeGen/X86/statepoint-duplicates-export.ll
Log Message:
-----------
[GC] Loosen ordering on statepoint reloads to allow CSE
We just removed a broken duplicate elimination algorithm in D75964, and after landed that it occurred to me that duplicate elimination is simply CSE. SelectionDAG has a build in CSE, so why wasn't that triggering? Well, it turns out we were overly conservative in the memory states for our reloads and CSE (rightly) considers the incoming memory state for a load part of the identity of the load.
By loosening the chain and allowing reordering, we also allow CSE. As shown in the test case, doing iterative CSE as we go is enough to eliminate duplicate stores in later statepoints as well. We key our (block local) slot map by SDValue, so commoning a previous pair of loads at construction time means we also common following stores.
Differential Revision: https://reviews.llvm.org/D76013
More information about the All-commits
mailing list