[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Reid Spencer
rspencer at reidspencer.com
Sat Oct 28 19:29:56 PDT 2006
Jim,
This commit broke llc, see below ..
On Sat, 2006-10-28 at 12:25 -0500, Jim Laskey wrote:
>
> Changes in directory llvm/lib/CodeGen/SelectionDAG:
>
> SelectionDAG.cpp updated: 1.359 -> 1.360
> ---
> Log message:
>
> Load and stores have not been uniqued properly.
>
> ---
> Diffs of the changes: (+42 -13)
>
> SelectionDAG.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++-------------
> 1 files changed, 42 insertions(+), 13 deletions(-)
>
>
> Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.359 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.360
> --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.359 Sat Oct 28 01:15:26 2006
> +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Oct 28 12:25:28 2006
> @@ -363,20 +363,24 @@
> ID.AddDouble(cast<ConstantFPSDNode>(N)->getValue());
> break;
> case ISD::TargetGlobalAddress:
> - case ISD::GlobalAddress:
> - ID.AddPointer(cast<GlobalAddressSDNode>(N)->getGlobal());
> - ID.AddInteger(cast<GlobalAddressSDNode>(N)->getOffset());
> + case ISD::GlobalAddress: {
> + GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(N);
> + ID.AddPointer(GA->getGlobal());
> + ID.AddInteger(GA->getOffset());
> break;
> + }
> case ISD::BasicBlock:
> ID.AddPointer(cast<BasicBlockSDNode>(N)->getBasicBlock());
> break;
> case ISD::Register:
> ID.AddInteger(cast<RegisterSDNode>(N)->getReg());
> break;
> - case ISD::SRCVALUE:
> - ID.AddPointer(cast<SrcValueSDNode>(N)->getValue());
> - ID.AddInteger(cast<SrcValueSDNode>(N)->getOffset());
> + case ISD::SRCVALUE: {
> + SrcValueSDNode *SV = cast<SrcValueSDNode>(N);
> + ID.AddPointer(SV->getValue());
> + ID.AddInteger(SV->getOffset());
> break;
> + }
> case ISD::FrameIndex:
> case ISD::TargetFrameIndex:
> ID.AddInteger(cast<FrameIndexSDNode>(N)->getIndex());
> @@ -386,16 +390,41 @@
> ID.AddInteger(cast<JumpTableSDNode>(N)->getIndex());
> break;
> case ISD::ConstantPool:
> - case ISD::TargetConstantPool:
> - ID.AddInteger(cast<ConstantPoolSDNode>(N)->getAlignment());
> - ID.AddInteger(cast<ConstantPoolSDNode>(N)->getOffset());
> - if (cast<ConstantPoolSDNode>(N)->isMachineConstantPoolEntry())
> - cast<ConstantPoolSDNode>(N)->getMachineCPVal()->
> - AddSelectionDAGCSEId(ID);
> + case ISD::TargetConstantPool: {
> + ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(N);
> + ID.AddInteger(CP->getAlignment());
> + ID.AddInteger(CP->getOffset());
> + if (CP->isMachineConstantPoolEntry())
> + CP->getMachineCPVal()->AddSelectionDAGCSEId(ID);
> else
> - ID.AddPointer(cast<ConstantPoolSDNode>(N)->getConstVal());
> + ID.AddPointer(CP->getConstVal());
> + break;
> + }
> + case ISD::VLOAD:
> + case ISD::EXTLOAD:
This value isn't in the same enum as that on which we're switching here.
However, it does have the same value (1) as NodeType::EntryToken. So
when N is an EntryToken it comes in here and the cast below fails. You
will see this:
/proj/llvm/llvm2/include/llvm/Support/Casting.h:199: typename
llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&) [with X =
llvm::LoadSDNode, Y = llvm::SDNode*]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.
Nick and I fixed it by simply removing the ISD::EXTLOAD case. Just
wanted to make sure that's the correct thing to do (seems to fix it).
> + case ISD::LOAD: {
> + LoadSDNode *LD = cast<LoadSDNode>(N);
> + ID.AddInteger(LD->getAddressingMode());
> + ID.AddInteger(LD->getExtensionType());
> + ID.AddInteger(LD->getLoadedVT());
> + ID.AddPointer(LD->getSrcValue());
> + ID.AddInteger(LD->getSrcValueOffset());
> + ID.AddInteger(LD->getAlignment());
> + ID.AddInteger(LD->isVolatile());
> + break;
> + }
> + case ISD::STORE: {
> + StoreSDNode *ST = cast<StoreSDNode>(N);
> + ID.AddInteger(ST->getAddressingMode());
> + ID.AddInteger(ST->isTruncatingStore());
> + ID.AddInteger(ST->getStoredVT());
> + ID.AddPointer(ST->getSrcValue());
> + ID.AddInteger(ST->getSrcValueOffset());
> + ID.AddInteger(ST->getAlignment());
> + ID.AddInteger(ST->isVolatile());
> break;
> }
> + }
> }
> }
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list