Skip to content

Commit

Permalink
SCCP: update for cmpxchg returning { iN, i1 } now.
Browse files Browse the repository at this point in the history
I accidentally missed this one since its use looked OK locally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210909 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
TNorthover committed Jun 13, 2014
1 parent 636ae2b commit e1a9d50
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Transforms/Scalar/SCCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,9 @@ class SCCPSolver : public InstVisitor<SCCPSolver> {
void visitResumeInst (TerminatorInst &I) { /*returns void*/ }
void visitUnreachableInst(TerminatorInst &I) { /*returns void*/ }
void visitFenceInst (FenceInst &I) { /*returns void*/ }
void visitAtomicCmpXchgInst (AtomicCmpXchgInst &I) { markOverdefined(&I); }
void visitAtomicCmpXchgInst(AtomicCmpXchgInst &I) {
markAnythingOverdefined(&I);
}
void visitAtomicRMWInst (AtomicRMWInst &I) { markOverdefined(&I); }
void visitAllocaInst (Instruction &I) { markOverdefined(&I); }
void visitVAArgInst (Instruction &I) { markAnythingOverdefined(&I); }
Expand Down
9 changes: 9 additions & 0 deletions test/Transforms/SCCP/atomic.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; RUN: opt < %s -sccp -S | FileCheck %s

define i1 @test_cmpxchg(i32* %addr, i32 %desired, i32 %new) {
; CHECK-LABEL: @test_cmpxchg
; CHECK: cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst
%val = cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst
%res = extractvalue { i32, i1 } %val, 1
ret i1 %res
}

0 comments on commit e1a9d50

Please sign in to comment.