llvmir some opt

This commit is contained in:
邓智航
2025-12-10 17:58:17 +08:00
commit 84827838e2
103 changed files with 5838 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package midend.llvm.instr;
import midend.llvm.type.IrPointerType;
import midend.llvm.value.IrValue;
public class LoadInstr extends IrInstr {
public LoadInstr(IrValue pointer, String name) {
super(((IrPointerType) pointer.getType()).getPointeeType(), name, IrInstrType.LOAD);
addUse(pointer);
}
public IrValue getPointer() {
return getUse(0);
}
public String toString() {
return getName() + " = load " + getType() + ", "
+ getPointer().getType() + " " + getPointer().getName();
}
}