[LLVMdev] [ia64] Assertion failed: (!OpInfo.AssignedRegs.Regs.empty() && "Couldn't allocate input reg!")
Marcel Moolenaar
xcllnt at mac.com
Tue May 20 13:59:09 PDT 2008
[correction]
On May 20, 2008, at 1:45 PM, Marcel Moolenaar wrote:
> All,
>
> The following IR is causing the assert:
>
> \begin{ll}
> ; ModuleID = 'x.bc'
> target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
> i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-
> f80:128:128"
> target triple = "ia64-portbld-freebsd8.0"
>
> define void @__ia64_set_fast_math() nounwind {
> entry:
> tail call void asm sideeffect "mov.m ar.fpsr=$0", "r"( i64
> 2709527404217215 ) nounwind
> ret void
> }
> \end{ll}
>
> (See gcc/config/ia64/crtfastmath.c)
>
> In llvm::TargetLowering::getRegForInlineAsmConstraint(), the "r"
> constraint
> (i.e. TargetLowering::C_RegisterClass) isn't handled and the function
> returns
> <pair>(0, NULL). However, it is explicitly called for that
> constraint by
> llvm::SelectionDAGLowering::visitInlineAsm():
It's llvm::TargetLowering::getRegClassForInlineAsmConstraint() that
returns an empty vector and thus is the root case of the assert.
It seems that llvm::TargetLowering::getRegForInlineAsmConstraint()
is supposed to work on a single (physical) register.
In GetRegistersForValue() is the following:
3817 // This is a reference to a register class that doesn't
directly correspond
3818 // to an LLVM register class. Allocate NumRegs consecutive,
available,
3819 // registers from the class.
3820 RegClassRegs =
TLI.getRegClassForInlineAsmConstraint(OpInfo.ConstraintCode,
3821
OpInfo.ConstraintVT);
Is it me or is the comment not really applicable to this particular
case?
thanks,
--
Marcel Moolenaar
xcllnt at mac.com
More information about the llvm-dev
mailing list