summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-12 18:38:26 +0000
committerChris Lattner <sabre@nondot.org>2005-01-12 18:38:26 +0000
commit7b1dae8032d9462da6801b74476e78c17abbd28f (patch)
tree25fda7fd9f6ed66a6d5bd86f9801c838752c9bf7 /llvm/lib
parent40e7982c2c3d1f3b2e7f42006cf500773268b9f7 (diff)
downloadbcm5719-llvm-7b1dae8032d9462da6801b74476e78c17abbd28f.tar.gz
bcm5719-llvm-7b1dae8032d9462da6801b74476e78c17abbd28f.zip
We can only fold a load into an op if there is exactly one use of the value.
Checking to see if the load has two uses is not equivalent, as the chain value may have zero uses. llvm-svn: 19518
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelPattern.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelPattern.cpp b/llvm/lib/Target/X86/X86ISelPattern.cpp
index 194c2fa517c..cc22506295f 100644
--- a/llvm/lib/Target/X86/X86ISelPattern.cpp
+++ b/llvm/lib/Target/X86/X86ISelPattern.cpp
@@ -979,7 +979,8 @@ bool ISel::isFoldableLoad(SDOperand Op) {
// If this load has already been emitted, we clearly can't fold it.
if (ExprMap.count(Op)) return false;
- return Op.Val->use_size() == 2;
+ // Finally, there can only be one use of its value.
+ return Op.Val->hasNUsesOfValue(1, 0);
}
/// EmitFoldedLoad - Ensure that the arguments of the load are code generated,
OpenPOWER on IntegriCloud