[SPIRV] Reordering primitive lookup
@@ -455,14 +455,14 @@ public class SPIRVUnary {
Logger.traceCodeGen(Logger.BACKEND.SPIRV, "emit SPIRVAddressCast with LIRKIND: " + getLIRKind().getPlatformKind());
SPIRVId idLoad = asm.module.getNextId();
- // We force to load a pointer to long
- SPIRVId typeLoad = asm.primitives.getTypePrimitive(SPIRVKind.OP_TYPE_INT_64);
-
SPIRVId addressToLoad = asm.lookUpLIRInstructions(address);
if (TornadoOptions.OPTIMIZE_LOAD_STORE_SPIRV_V2 || TornadoOptions.OPTIMIZE_LOAD_STORE_SPIRV) {
idLoad = addressToLoad;
} else {
+ // We force to load a pointer to long
+ SPIRVId typeLoad = asm.primitives.getTypePrimitive(SPIRVKind.OP_TYPE_INT_64);
+
asm.currentBlockScope().add(new SPIRVOpLoad( //
typeLoad, //
idLoad, //
