[llvm-commits] [llvm] r67098 - /llvm/branches/Apple/Dib/lib/Target/X86/X86ISelDAGToDAG.cpp
Bill Wendling
isanbard at gmail.com
Tue Mar 17 12:57:41 PDT 2009
Author: void
Date: Tue Mar 17 14:57:40 2009
New Revision: 67098
URL: http://llvm.org/viewvc/llvm-project?rev=67098&view=rev
Log:
--- Merging (from foreign repository) r67001 into '.':
U lib/Target/X86/X86ISelDAGToDAG.cpp
Don't forego folding of loads into 64-bit adds when the other
operand is a signed 32-bit immediate. Unlike with the 8-bit
signed immediate case, it isn't actually smaller to fold a
32-bit signed immediate instead of a load. In fact, it's
larger in the case of 32-bit unsigned immediates, because
they can be materialized with movl instead of movq.
Modified:
llvm/branches/Apple/Dib/lib/Target/X86/X86ISelDAGToDAG.cpp
Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=67098&r1=67097&r2=67098&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Mar 17 14:57:40 2009
@@ -314,16 +314,9 @@
// addl 4(%esp), %eax
// The former is 2 bytes shorter. In case where the increment is 1, then
// the saving can be 4 bytes (by using incl %eax).
- ConstantSDNode *Imm = dyn_cast<ConstantSDNode>(U->getOperand(1));
- if (Imm) {
- if (U->getValueType(0) == MVT::i64) {
- if ((int32_t)Imm->getZExtValue() == (int64_t)Imm->getZExtValue())
- return false;
- } else {
- if ((int8_t)Imm->getZExtValue() == (int64_t)Imm->getZExtValue())
- return false;
- }
- }
+ if (ConstantSDNode *Imm = dyn_cast<ConstantSDNode>(U->getOperand(1)))
+ if (Imm->getAPIntValue().isSignedIntN(8))
+ return false;
}
}
More information about the llvm-commits
mailing list