mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
EarlyCSE: It isn't safe to CSE across synchronization boundaries
This fixes PR22514. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
88972080a3
commit
0f8bd667a1
@ -527,6 +527,9 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
|
||||
// Ignore volatile loads.
|
||||
if (MemInst.isVolatile()) {
|
||||
LastStore = nullptr;
|
||||
// Don't CSE across synchronization boundaries.
|
||||
if (Inst->mayWriteToMemory())
|
||||
++CurrentGeneration;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -193,4 +193,10 @@ define void @test11(i32 *%P) {
|
||||
; CHECK-NEXT: ret void
|
||||
}
|
||||
|
||||
|
||||
define i32 @test12(i1 %B, i32* %P1, i32* %P2) {
|
||||
%load0 = load i32* %P1
|
||||
%1 = load atomic i32* %P2 seq_cst, align 4
|
||||
%load1 = load i32* %P1
|
||||
%sel = select i1 %B, i32 %load0, i32 %load1
|
||||
ret i32 %sel
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user