diff options
author | Chris Lattner <sabre@nondot.org> | 2011-05-17 07:22:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-05-17 07:22:33 +0000 |
commit | 5d4718b1c780aa7f393202307791dd7cfaaca1f0 (patch) | |
tree | 6429a3de2307aa293274bddb4aa7bf7922389e7c /lib/Target/X86/README.txt | |
parent | 71753050b1b0be268aed041dfdd77135e29f9286 (diff) | |
download | external_llvm-5d4718b1c780aa7f393202307791dd7cfaaca1f0.zip external_llvm-5d4718b1c780aa7f393202307791dd7cfaaca1f0.tar.gz external_llvm-5d4718b1c780aa7f393202307791dd7cfaaca1f0.tar.bz2 |
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/README.txt')
-rw-r--r-- | lib/Target/X86/README.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index ea3014e..560947a 100644 --- a/lib/Target/X86/README.txt +++ b/lib/Target/X86/README.txt @@ -2040,3 +2040,29 @@ _clamp2: ## @clamp2 The move of 0 could be scheduled above the test to make it is xor reg,reg. //===---------------------------------------------------------------------===// + +GCC PR48986. We currently compile this: + +void bar(void); +void yyy(int* p) { + if (__sync_fetch_and_add(p, -1) == 1) + bar(); +} + +into: + movl $-1, %eax + lock + xaddl %eax, (%rdi) + cmpl $1, %eax + je LBB0_2 + +Instead we could generate: + + lock + dec %rdi + je LBB0_2 + +The trick is to match "fetch_and_add(X, -C) == C". + +//===---------------------------------------------------------------------===// + |