mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[cse] Add support for float literals.
Swift SVN r10817
This commit is contained in:
@@ -61,6 +61,7 @@ namespace {
|
||||
case ValueKind::BuiltinFunctionRefInst:
|
||||
case ValueKind::GlobalAddrInst:
|
||||
case ValueKind::IntegerLiteralInst:
|
||||
case ValueKind::FloatLiteralInst:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -107,6 +108,12 @@ unsigned llvm::DenseMapInfo<SimpleValue>::getHashValue(SimpleValue Val) {
|
||||
X->getType(),
|
||||
X->getValue());
|
||||
}
|
||||
case ValueKind::FloatLiteralInst: {
|
||||
auto *X = cast<FloatLiteralInst>(Inst);
|
||||
return llvm::hash_combine(unsigned(ValueKind::FloatLiteralInst),
|
||||
X->getType(),
|
||||
X->getBits());
|
||||
}
|
||||
default:
|
||||
llvm_unreachable("Unhandled ValueKind.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user