Displaying 3 results from an estimated 3 matches for "changetoglobaladdress".
2015 Jun 16
2
[LLVMdev] Replacing a Reg MachineOperand with a non-Reg MachineOperand?
...; uses, I get an error that vreg5 is somehow not a register?
>
> So, the MI looks like this:
>
> vreg5 = MOV <ga:@a>
> vreg2 = ABS vreg5
> ...
> ...
> vreg9 = SUB vreg7, vreg5
>
> In this case, I want to eliminate vreg5 and replace it with <ga:@a>, the
> ChangeToGlobalAddress is working for the ABS but for some reason, when I
> get the uses of vreg5 it tells me it's not an register operand (vreg5 is
> not), which makes sense since ChangeToGlobalAddress is calling
> removeRegOperandFromUseList(this) for ABS, but it's confusing because then
> why does...
2015 Jun 16
2
[LLVMdev] Replacing a Reg MachineOperand with a non-Reg MachineOperand?
...operand stores the register id in a union together with the offset that's
used by the global address operand.
Just add 'setOffset(0)' to your change method and that should solve your
problem.
2015-06-16 9:15 GMT-07:00 Ryan Taylor <ryta1203 at gmail.com>:
> So I have this for ChangeToGlobalAddress(const GlobalValue *GV):
>
> ...
> OpKind = MO_GlobalAddress;
> Contents.OffsetedInfo.Val.GV = GV;
>
> and then I use the function like this:
>
>
> MI->getOperand(1).ChangeToGlobalAddress(MII->getOperand(1).getOperand.getGlobal());
>
> The operand ends up being...
2015 Jun 16
2
[LLVMdev] Replacing a Reg MachineOperand with a non-Reg MachineOperand?
Tom,
My current example is a global address; however, it could be any operand
in theory. The arch allows for direct mem op support for ex instructions,
so it could be any type of address or any type of imm or any type of
register.
For example, we are using intrinsics for some instructions since LLVM
does not support them. Table gen does not allow for matching to direct mem
op because the