aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-11 12:25:55 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-11 12:25:55 -0800
commitc775576ae72515303b2da02021482eddae91efd6 (patch)
tree50398741643f1f0b0f6b22405a11a2515a1bd1b0 /lib/Transforms
parentf7dee4ac94ca763fa329ff8d274550e359848dd2 (diff)
handle i64 undef; helps #5
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];