diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-01-18 04:18:32 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-01-18 04:18:32 +0000 |
| commit | ed246ec0d2042065d4c591e0a24b16f46fff1da9 (patch) | |
| tree | 5ce508cad7ea814625914275ac29468e6f662408 /llvm/lib | |
| parent | c227ad26402999af8ec2236f6b84fa76c8c5ed0c (diff) | |
| download | bcm5719-llvm-ed246ec0d2042065d4c591e0a24b16f46fff1da9.tar.gz bcm5719-llvm-ed246ec0d2042065d4c591e0a24b16f46fff1da9.zip | |
Do not emit loads multiple times, potentially in the wrong places.
llvm-svn: 19661
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelPattern.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelPattern.cpp b/llvm/lib/Target/X86/X86ISelPattern.cpp index 7b465cd84ca..4db13aa9ec2 100644 --- a/llvm/lib/Target/X86/X86ISelPattern.cpp +++ b/llvm/lib/Target/X86/X86ISelPattern.cpp @@ -573,7 +573,7 @@ bool ISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM) { // Okay, we know that we have a scale by now. However, if the scaled // value is an add of something and a constant, we can fold the // constant into the disp field here. - if (ShVal.Val->getOpcode() == ISD::ADD && !ExprMap.count(ShVal) && + if (ShVal.Val->getOpcode() == ISD::ADD && ShVal.hasOneUse() && isa<ConstantSDNode>(ShVal.Val->getOperand(1))) { AM.IndexReg = ShVal.Val->getOperand(0); ConstantSDNode *AddVal = @@ -604,7 +604,7 @@ bool ISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM) { // Okay, we know that we have a scale by now. However, if the scaled // value is an add of something and a constant, we can fold the // constant into the disp field here. - if (MulVal.Val->getOpcode() == ISD::ADD && !ExprMap.count(MulVal) && + if (MulVal.Val->getOpcode() == ISD::ADD && MulVal.hasOneUse() && isa<ConstantSDNode>(MulVal.Val->getOperand(1))) { Reg = MulVal.Val->getOperand(0); ConstantSDNode *AddVal = |

