aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/NaCl/ExpandI64.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/NaCl/ExpandI64.cpp b/lib/Transforms/NaCl/ExpandI64.cpp
index 23b2fdc307..00e5945ca6 100644
--- a/lib/Transforms/NaCl/ExpandI64.cpp
+++ b/lib/Transforms/NaCl/ExpandI64.cpp
@@ -611,17 +611,21 @@ void ExpandI64::splitInst(Instruction *I, DataLayout& DL) {
}
LowHighPair ExpandI64::getLowHigh(Value *V) {
+ Type *i32 = Type::getInt32Ty(V->getContext());
if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
uint64_t C = CI->getZExtValue();
- Type *i32 = Type::getInt32Ty(V->getContext());
LowHighPair LowHigh;
LowHigh.Low = ConstantInt::get(i32, (uint32_t)C);
LowHigh.High = ConstantInt::get(i32, (uint32_t)(C >> 32));
- assert(LowHigh.Low && LowHigh.High);
return LowHigh;
} else if (Instruction *I = dyn_cast<Instruction>(V)) {
assert(Splits.find(I) != Splits.end());
return Splits[I].LowHigh;
+ } else if (isa<UndefValue>(V)) {
+ LowHighPair LowHigh;
+ LowHigh.Low = ConstantInt::get(i32, 0);
+ LowHigh.High = ConstantInt::get(i32, 0);
+ return LowHigh;
} else {
assert(SplitArgs.find(V) != SplitArgs.end());
return SplitArgs[V];