diff options
author | Ruiling Song <ruiling.song@intel.com> | 2015-02-05 14:22:21 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-02-11 16:32:09 +0800 |
commit | 029c4c87cd0d8e01625ede68f183d798472fe82c (patch) | |
tree | ad75aeff1db066c13d7910df26a295f44632f124 | |
parent | 19b817de8b5f9767167316907149ee48b87f214e (diff) |
GBE: Fix a bug in legalize pass.
The type may be float.
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r-- | backend/src/llvm/ExpandLargeIntegers.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/src/llvm/ExpandLargeIntegers.cpp b/backend/src/llvm/ExpandLargeIntegers.cpp index 5b620fcb..2743cb12 100644 --- a/backend/src/llvm/ExpandLargeIntegers.cpp +++ b/backend/src/llvm/ExpandLargeIntegers.cpp @@ -332,7 +332,7 @@ static Value *buildVectorOrScalar(ConversionState &State, IRBuilder<> &IRB, Smal Value * vec = NULL; unsigned ElemNo = Elements.size(); Type *ElemTy = Elements[0]->getType(); - bool KeepInsert = isLegalBitSize(ElemTy->getIntegerBitWidth() * ElemNo); + bool KeepInsert = isLegalBitSize(ElemTy->getPrimitiveSizeInBits() * ElemNo); for (unsigned i = 0; i < ElemNo; ++i) { Value *tmp = vec ? vec : UndefValue::get(VectorType::get(ElemTy, ElemNo)); Value *idx = ConstantInt::get(IntTy, i); @@ -459,8 +459,8 @@ static void convertInstruction(Instruction *Inst, ConversionState &State, TypePair OpTys = getExpandedIntTypes(LargeTy); Value *Lo, *Hi; - unsigned LowNo = OpTys.Lo->getIntegerBitWidth() / ElemTy->getIntegerBitWidth(); - unsigned HighNo = OpTys.Hi->getIntegerBitWidth() / ElemTy->getIntegerBitWidth(); + unsigned LowNo = OpTys.Lo->getIntegerBitWidth() / ElemTy->getPrimitiveSizeInBits(); + unsigned HighNo = OpTys.Hi->getIntegerBitWidth() / ElemTy->getPrimitiveSizeInBits(); SmallVector<Value *, 16> LoElems; for (unsigned i = 0; i < LowNo; ++i) |