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,24 @@
package midend.llvm.instr;
import midend.llvm.type.IrInterType;
import midend.llvm.value.IrValue;
public class AluInstr extends IrInstr {
private AluType alutype;
public AluInstr(String name, String op, IrValue left, IrValue right) {
super(IrInterType.INT32, name, IrInstrType.ALU);
this.alutype = AluType.getAluType(op);
addUse(left);
addUse(right);
}
public AluType getAluType() {
return alutype;
}
public String toString() {
return getName() + " = " + alutype.toString() + " " + getType()
+ " " + getUse(0).getName() + ", " + getUse(1).getName();
}
}