From 304c7594cd2d904072917bb79d0aa340090d8296 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 2 Dec 2018 20:59:08 +0000 Subject: Ignore `ir_emit_byte_swap` for constant values --- src/ir.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index bf595251e..ea7719af2 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -4372,6 +4372,9 @@ irValue *ir_emit_uintptr_to_ptr(irProcedure *proc, irValue *value, Type *t) { irValue *ir_emit_byte_swap(irProcedure *proc, irValue *value, Type *t) { Type *vt = core_type(ir_type(value)); + if (is_type_untyped(vt)) { + return value; + } GB_ASSERT(type_size_of(vt) == type_size_of(t)); return ir_emit(proc, ir_instr_conv(proc, irConv_byteswap, value, vt, t)); } -- cgit v1.2.3