summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ISelLowering.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-07-30 08:33:02 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-07-30 08:33:02 +0000
commite62288fdd408fe52eb3d15cd2d139eaca9fd5a22 (patch)
tree469887341c356d7f98e90e17161ee37a0cd7ec90 /llvm/lib/Target/X86/X86ISelLowering.h
parent6afdc5e6944b2947aa843f21599801a9c9307929 (diff)
downloadbcm5719-llvm-e62288fdd408fe52eb3d15cd2d139eaca9fd5a22.tar.gz
bcm5719-llvm-e62288fdd408fe52eb3d15cd2d139eaca9fd5a22.zip
Optimize some common usage patterns of atomic built-ins __sync_add_and_fetch() and __sync_sub_and_fetch.
When the return value is not used (i.e. only care about the value in the memory), x86 does not have to use add to implement these. Instead, it can use add, sub, inc, dec instructions with the "lock" prefix. This is currently implemented using a bit of instruction selection trick. The issue is the target independent pattern produces one output and a chain and we want to map it into one that just output a chain. The current trick is to select it into a merge_values with the first definition being an implicit_def. The proper solution is to add new ISD opcodes for the no-output variant. DAG combiner can then transform the node before it gets to target node selection. Problem #2 is we are adding a whole bunch of x86 atomic instructions when in fact these instructions are identical to the non-lock versions. We need a way to add target specific information to target nodes and have this information carried over to machine instructions. Asm printer (or JIT) can use this information to add the "lock" prefix. llvm-svn: 77582
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.h')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h
index c3da894f0e4..579b42fab27 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.h
+++ b/llvm/lib/Target/X86/X86ISelLowering.h
@@ -336,6 +336,10 @@ namespace llvm {
/// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFLW
/// instructions.
unsigned getShufflePSHUFLWImmediate(SDNode *N);
+
+ /// isZeroNode - Returns true if Elt is a constant zero or a floating point
+ /// constant +0.0.
+ bool isZeroNode(SDValue Elt);
}
//===--------------------------------------------------------------------===//
OpenPOWER on IntegriCloud