From lattner at cs.uiuc.edu Mon Jul 18 18:07:44 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 18 Jul 2005 18:07:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200507182307.SAA29750@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.357 -> 1.358 --- Log message: When transforming &A[i] < &A[j] -> i < j, make sure to perform the comparison as a signed compare. This patch may fix PR597: http://llvm.cs.uiuc.edu/PR597 , but is correct in any case. --- Diffs of the changes: (+11 -4) InstructionCombining.cpp | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.357 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.358 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.357 Thu Jul 7 15:40:38 2005 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jul 18 18:07:33 2005 @@ -2367,10 +2367,17 @@ else if (NumDifferences == 1) { Value *LHSV = GEPLHS->getOperand(DiffOperand); Value *RHSV = GEPRHS->getOperand(DiffOperand); - if (LHSV->getType() != RHSV->getType()) - LHSV = InsertNewInstBefore(new CastInst(LHSV, RHSV->getType(), - LHSV->getName()+".c"), I); - return new SetCondInst(Cond, LHSV, RHSV); + + // Convert the operands to signed values to make sure to perform a + // signed comparison. + const Type *NewTy = LHSV->getType()->getSignedVersion(); + if (LHSV->getType() != NewTy) + LHSV = InsertNewInstBefore(new CastInst(LHSV, NewTy, + LHSV->getName()), I); + if (RHSV->getType() != NewTy) + RHSV = InsertNewInstBefore(new CastInst(RHSV, NewTy, + RHSV->getName()), I); + return new SetCondInst(Cond, LHSV, RHSV); } } From reid at x10sys.com Mon Jul 18 20:36:47 2005 From: reid at x10sys.com (Reid Spencer) Date: Mon, 18 Jul 2005 20:36:47 -0500 Subject: [llvm-commits] CVS: llvm/docs/CodeGenerator.html Message-ID: <200507190136.UAA32763@zion.cs.uiuc.edu> Changes in directory llvm/docs: CodeGenerator.html updated: 1.15 -> 1.16 --- Log message: Provide descriptions for the TargetInstrInfo and TargetFrameInfo classes. --- Diffs of the changes: (+21 -1) CodeGenerator.html | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletion(-) Index: llvm/docs/CodeGenerator.html diff -u llvm/docs/CodeGenerator.html:1.15 llvm/docs/CodeGenerator.html:1.16 --- llvm/docs/CodeGenerator.html:1.15 Mon Jul 11 19:20:49 2005 +++ llvm/docs/CodeGenerator.html Mon Jul 18 20:36:35 2005 @@ -383,11 +383,31 @@ The TargetInstrInfo class +
The TargetInstrInfo class is used to describe the machine + instructions supported by the target. It is essentially an array of + TargetInstrDescriptor objects, each of which describes one + instruction the target supports. Descriptors define things like the mnemonic + for the opcode, the number of operands, the size of the largets immediate + field the instruction can contain, the latency of the instruction in machine + cycles, etc.
+The TargetFrameInfo class is used to provide information about the + stack frame layout of the target. It holds the direction of stack growth, + the known stack alignment on entry to each function, and the offset to the + locals area. The offset to the local area is the offset from the stack + pointer on function entry to the first location where function data (local + variables, spill locations) can be stored.
+The class also provides several functions for computing alignment and + offsets for various situations.
+