Index: src/compiler/x64/instruction-selector-x64.cc |
diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc |
index 7c72587ab69e1ad7e20707ae57bc070e9326ed2e..c5e31278d9c2263bded185314a5529e58aec7ff0 100644 |
--- a/src/compiler/x64/instruction-selector-x64.cc |
+++ b/src/compiler/x64/instruction-selector-x64.cc |
@@ -1250,6 +1250,19 @@ bool ZeroExtendsWord32ToWord64(Node* node) { |
return false; |
} |
} |
+ case IrOpcode::kLoad: { |
+ // The movzxbl/movsxbl/movzxwl/movsxwl operations implicitly zero-extend |
+ // to 64-bit on x64, |
+ // so the zero-extension is a no-op. |
+ LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
+ switch (load_rep.representation()) { |
+ case MachineRepresentation::kWord8: |
+ case MachineRepresentation::kWord16: |
+ return true; |
+ default: |
+ return false; |
+ } |
+ } |
default: |
return false; |
} |