diff options
author | Duncan Sands <baldrick@free.fr> | 2008-06-09 15:48:25 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-06-09 15:48:25 +0000 |
commit | eedb3bf6a63653ac4c76e5f64764294742b9c70a (patch) | |
tree | 2b795fe6a83c7aa6f01177f7f051be35d19a7538 /lib | |
parent | 9115c7e89bca18364dba54ec8c7bba2da39b20d8 (diff) | |
download | external_llvm-eedb3bf6a63653ac4c76e5f64764294742b9c70a.zip external_llvm-eedb3bf6a63653ac4c76e5f64764294742b9c70a.tar.gz external_llvm-eedb3bf6a63653ac4c76e5f64764294742b9c70a.tar.bz2 |
Various tweaks related to apint codegen. No functionality
change for non-funky-sized integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index ea96e5c..8696bcf 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1785,7 +1785,7 @@ SDOperand DAGCombiner::visitAND(SDNode *N) { // Loading a non-byte sized integer is only valid if the extra bits // in memory that complete the byte are zero, which is not known here. // TODO: remove isSimple check when apint codegen support lands. - EVT.isSimple() && EVT.getSizeInBits() == EVT.getStoreSizeInBits() && + EVT.isSimple() && EVT.isByteSized() && (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) { MVT PtrType = N0.getOperand(1).getValueType(); // For big endian targets, we need to add an offset to the pointer to @@ -3181,7 +3181,7 @@ SDOperand DAGCombiner::ReduceLoadWidth(SDNode *N) { // Do not allow folding to a non-byte-sized integer here. These only // load correctly if the extra bits in memory that complete the byte // are zero, which is not known here. - VT.getSizeInBits() == VT.getStoreSizeInBits()) { + VT.isByteSized()) { assert(N0.getValueType().getSizeInBits() > EVTBits && "Cannot truncate to larger type!"); LoadSDNode *LN0 = cast<LoadSDNode>(N0); diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp index b0a8475..5c68fe2 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp @@ -94,7 +94,7 @@ SDOperand DAGTypeLegalizer::PromoteResult_Constant(SDNode *N) { MVT VT = N->getValueType(0); // Zero extend things like i1, sign extend everything else. It shouldn't // matter in theory which one we pick, but this tends to give better code? - unsigned Opc = VT != MVT::i1 ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND; + unsigned Opc = VT.isByteSized() ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND; SDOperand Result = DAG.getNode(Opc, TLI.getTypeToTransformTo(VT), SDOperand(N, 0)); assert(isa<ConstantSDNode>(Result) && "Didn't constant fold ext?"); diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 81cdf46..fe752de 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -250,7 +250,7 @@ void TargetLowering::computeRegisterProperties() { NumRegistersForVT[MVT::isVoid] = 0; // Find the largest integer register class. - unsigned LargestIntReg = MVT::i128; + unsigned LargestIntReg = MVT::LAST_INTEGER_VALUETYPE; for (; RegClassForVT[LargestIntReg] == 0; --LargestIntReg) assert(LargestIntReg != MVT::i1 && "No integer registers defined!"); |