|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
27 | 27 | import jdk.graal.compiler.core.common.type.IntegerStamp;
|
28 | 28 | import jdk.graal.compiler.core.common.type.Stamp;
|
29 | 29 | import jdk.graal.compiler.graph.NodeClass;
|
| 30 | +import jdk.graal.compiler.nodeinfo.NodeInfo; |
30 | 31 | import jdk.graal.compiler.nodes.ConstantNode;
|
31 | 32 | import jdk.graal.compiler.nodes.NodeView;
|
32 | 33 | import jdk.graal.compiler.nodes.ValueNode;
|
33 | 34 | import jdk.graal.compiler.nodes.extended.GuardingNode;
|
34 | 35 | import jdk.graal.compiler.nodes.spi.CanonicalizerTool;
|
35 | 36 | import jdk.graal.compiler.nodes.spi.LIRLowerable;
|
36 | 37 | import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool;
|
37 |
| -import jdk.graal.compiler.nodeinfo.NodeInfo; |
38 |
| - |
39 | 38 | import jdk.vm.ci.code.CodeUtil;
|
40 | 39 |
|
41 | 40 | @NodeInfo(shortName = "|/|")
|
@@ -64,6 +63,9 @@ public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode for
|
64 | 63 |
|
65 | 64 | @SuppressWarnings("unused")
|
66 | 65 | private static ValueNode canonical(UnsignedDivNode self, ValueNode forX, ValueNode forY, GuardingNode zeroCheck, Stamp stamp, NodeView view) {
|
| 66 | + if (!(stamp instanceof IntegerStamp)) { |
| 67 | + return self != null ? self : new UnsignedDivNode(forX, forY, zeroCheck); |
| 68 | + } |
67 | 69 | int bits = ((IntegerStamp) stamp).getBits();
|
68 | 70 | if (forX.isConstant() && forY.isConstant()) {
|
69 | 71 | long yConst = CodeUtil.zeroExtend(forY.asJavaConstant().asLong(), bits);
|
|
0 commit comments