[llvm] r279528 - Fix some more asserts after r279466.

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 16:46:44 PDT 2016


On 08/23/2016 01:06 PM, Pete Cooper wrote:
>> On Aug 23, 2016, at 12:11 PM, Philip Reames <listmail at philipreames.com> wrote:
>>
>> This really doesn't feel right.
> I agree. It doesn’t feel like the right solution, but I didn’t have a better idea and was in a rush to fix the bots.
>> These uses aren't really asking for the name of the intrinsic with no types; they're asking for some new notion of a "base name".  In particular, if really feels like a design mistake to allow asking for the name of a parametric intrinsic without providing the right number of types.
> I could add an Intrinsic::getBaseName method and change these callers.  Not sure if thats more or less confusing for folks?  It would be yet another method to Intrinsic, but if its clearer then I’m happy to add it.
This would be my preference.
>
> Cheers,
> Pete
>> Philip
>>
>> On 08/23/2016 09:23 AM, Pete Cooper via llvm-commits wrote:
>>> Author: pete
>>> Date: Tue Aug 23 11:23:45 2016
>>> New Revision: 279528
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=279528&view=rev
>>> Log:
>>> Fix some more asserts after r279466.
>>>
>>> That commit added a new version of Intrinsic::getName which should only
>>> be called when the intrinsic has no overloaded types.  There are several
>>> debugging paths, such as SDNode::dump which are printing the name of the
>>> intrinsic but don't have the overloaded types.  These paths should be ok
>>> to just print the name instead of crashing.
>>>
>>> The fix here is ultimately to just add a 'None' second argument as that
>>> calls the overload capable getName, which is less efficient, but this is a
>>> debugging path anyway, and not perf critical.
>>>
>>> Thanks to Björn Pettersson for pointing out that there were more crashes.
>>>
>>> Modified:
>>>      llvm/trunk/lib/CodeGen/MachineInstr.cpp
>>>      llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
>>>      llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
>>>
>>> Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=279528&r1=279527&r2=279528&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Aug 23 11:23:45 2016
>>> @@ -470,7 +470,7 @@ void MachineOperand::print(raw_ostream &
>>>     case MachineOperand::MO_IntrinsicID: {
>>>       Intrinsic::ID ID = getIntrinsicID();
>>>       if (ID < Intrinsic::num_intrinsics)
>>> -      OS << "<intrinsic:@" << Intrinsic::getName(ID) << ')';
>>> +      OS << "<intrinsic:@" << Intrinsic::getName(ID, None) << ')';
>>>       else if (IntrinsicInfo)
>>>         OS << "<intrinsic:@" << IntrinsicInfo->getName(ID) << ')';
>>>       else
>>>
>>> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp?rev=279528&r1=279527&r2=279528&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp Tue Aug 23 11:23:45 2016
>>> @@ -119,7 +119,7 @@ std::string SDNode::getOperationName(con
>>>       unsigned OpNo = getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 0 : 1;
>>>       unsigned IID = cast<ConstantSDNode>(getOperand(OpNo))->getZExtValue();
>>>       if (IID < Intrinsic::num_intrinsics)
>>> -      return Intrinsic::getName((Intrinsic::ID)IID);
>>> +      return Intrinsic::getName((Intrinsic::ID)IID, None);
>>>       else if (const TargetIntrinsicInfo *TII = G->getTarget().getIntrinsicInfo())
>>>         return TII->getName(IID);
>>>       llvm_unreachable("Invalid intrinsic ID");
>>>
>>> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=279528&r1=279527&r2=279528&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Aug 23 11:23:45 2016
>>> @@ -3579,7 +3579,7 @@ void SelectionDAGISel::CannotYetSelect(S
>>>       unsigned iid =
>>>         cast<ConstantSDNode>(N->getOperand(HasInputChain))->getZExtValue();
>>>       if (iid < Intrinsic::num_intrinsics)
>>> -      Msg << "intrinsic %" << Intrinsic::getName((Intrinsic::ID)iid);
>>> +      Msg << "intrinsic %" << Intrinsic::getName((Intrinsic::ID)iid, None);
>>>       else if (const TargetIntrinsicInfo *TII = TM.getIntrinsicInfo())
>>>         Msg << "target intrinsic %" << TII->getName(iid);
>>>       else
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>



More information about the llvm-commits mailing list