[llvm] r195401 - Fix a typo where we were creating <def, kill> operands instead of

David Blaikie dblaikie at gmail.com
Fri Nov 22 10:22:55 PST 2013


On Thu, Nov 21, 2013 at 4:46 PM, Lang Hames <lhames at gmail.com> wrote:

> Author: lhames
> Date: Thu Nov 21 18:46:32 2013
> New Revision: 195401
>
> URL: http://llvm.org/viewvc/llvm-project?rev=195401&view=rev
> Log:
> Fix a typo where we were creating <def,kill> operands instead of
> <def,dead> ones.
>
> Add an assertion to make sure we catch this in the future.
>
> Fixes <rdar://problem/15464559>.
>
>
> Modified:
>     llvm/trunk/include/llvm/CodeGen/MachineOperand.h
>     llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
>
> Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOperand.h?rev=195401&r1=195400&r2=195401&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/CodeGen/MachineOperand.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/MachineOperand.h Thu Nov 21 18:46:32
> 2013
> @@ -564,6 +564,8 @@ public:
>                                    unsigned SubReg = 0,
>                                    bool isDebug = false,
>                                    bool isInternalRead = false) {
> +    assert(!(isDead && !isDef) && "Dead flag on non-def");
> +    assert(!(isKill && isDef) && "Kill flag on def");
>      MachineOperand Op(MachineOperand::MO_Register);
>      Op.IsDef = isDef;
>      Op.IsImp = isImp;
>
> Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=195401&r1=195400&r2=195401&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Nov 21 18:46:32 2013
> @@ -1934,7 +1934,8 @@ bool llvm::tryFoldSPUpdateIntoPushPop(Ma
>        return false;
>
>      // Mark the unimportant registers as <def,dead> in the POP.
> -    RegList.push_back(MachineOperand::CreateReg(CurReg, true, false,
> true));
> +    RegList.push_back(MachineOperand::CreateReg(CurReg, true, false,
> false,
> +                                                true));
>

could/should this API be improved to be more legible? (a recent change to a
similarly illegible API involved squashing all the bool flags into an enum
bitfield as passing it as FOO | BAR, etc instead of "false, true, true" -
alternatively two-value enums could be introduced separately for each
parameter)


>    }
>
>    if (RegsNeeded > 0)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131122/3cac30f3/attachment.html>


More information about the llvm-commits mailing list