Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: src/compiler/representation-change.h

Issue 1462503005: [turbofan] Simplified lowering - introduce the concept of UseInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: struct -> class Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/representation-change.h
diff --git a/src/compiler/representation-change.h b/src/compiler/representation-change.h
index 0890c7b66b63cea234a5664a1695fe829066c4b3..b89d9363de8f3e5f2c9b56f8df9182308c436c5c 100644
--- a/src/compiler/representation-change.h
+++ b/src/compiler/representation-change.h
@@ -52,7 +52,7 @@ class RepresentationChanger {
if (use_type & kRepTagged) {
return GetTaggedRepresentationFor(node, output_type);
} else if (use_type & kRepFloat32) {
- return GetFloat32RepresentationFor(node, output_type);
+ return GetFloat32RepresentationFor(node, output_type, use_type);
} else if (use_type & kRepFloat64) {
return GetFloat64RepresentationFor(node, output_type, use_type);
} else if (use_type & kRepBit) {
@@ -115,7 +115,8 @@ class RepresentationChanger {
return jsgraph()->graph()->NewNode(op, node);
}
- Node* GetFloat32RepresentationFor(Node* node, MachineTypeUnion output_type) {
+ Node* GetFloat32RepresentationFor(Node* node, MachineTypeUnion output_type,
+ MachineTypeUnion truncation) {
// Eagerly fold representation changes for constants.
switch (node->opcode()) {
case IrOpcode::kFloat64Constant:
@@ -143,6 +144,10 @@ class RepresentationChanger {
if (output_type & kTypeUint32) {
op = machine()->ChangeUint32ToFloat64();
} else {
+ // Either the output is int32 or the uses only care about the
+ // low 32 bits (so we can pick int32 safely).
+ DCHECK(output_type & kTypeInt32 ||
+ !(truncation & ~(kTypeInt32 | kTypeUint32 | kRepMask)));
op = machine()->ChangeInt32ToFloat64();
}
// int32 -> float64 -> float32
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698