summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndreas Fried <andreas.fried@kit.edu>2021-10-29 13:45:17 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commit540d72365c2d488df1e895d3de0c25b205e6b423 (patch)
tree17335dca05521eb66ee24c60d1f6afc570a56697
parent32171919f33f18d7104424cec0a68c403a55510a (diff)
Check that entity is present for lui and addi nodes.
If the nodes were produced as a translation of an IR Const node, they don't have an entity, just an immediate value (and therefore they might be compressible).
-rw-r--r--ir/be/riscv/riscv_compression.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ir/be/riscv/riscv_compression.c b/ir/be/riscv/riscv_compression.c
index 33561ac..53da7a2 100644
--- a/ir/be/riscv/riscv_compression.c
+++ b/ir/be/riscv/riscv_compression.c
@@ -74,7 +74,7 @@ int riscv_get_op_compression_requirements(ir_node const *const node)
// and the resulting load may be compressible. If not, the value will be inserted at link-time
// and the load instructions may never be compressed.
// ir_entity* entity = imm->ent;
- // if (!entity && !entity_has_definition(entity)) {
+ // if (entity && !entity && !entity_has_definition(entity)) {
// requirement = comp_req_never;
// break;
// }
@@ -94,7 +94,7 @@ int riscv_get_op_compression_requirements(ir_node const *const node)
// See above for rationale
// ir_entity* entity = imm->ent;
- // if (!entity && !entity_has_definition(entity)) {
+ // if (entity && !entity && !entity_has_definition(entity)) {
// requirement = comp_req_never;
// break;
// }