File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
llvm/include/llvm/CodeGen Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -702,24 +702,25 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
702
702
case Instruction::ZExt:
703
703
if (TLI->isZExtFree (SrcLT.second , DstLT.second ))
704
704
return 0 ;
705
- break ;
706
- case Instruction::AddrSpaceCast:
707
- if (TLI->isFreeAddrSpaceCast (Src->getPointerAddressSpace (),
708
- Dst->getPointerAddressSpace ()))
709
- return 0 ;
710
- break ;
711
- }
712
-
713
- // If this is a zext/sext of a load, return 0 if the corresponding
714
- // extending load exists on target.
715
- if ((Opcode == Instruction::ZExt || Opcode == Instruction::SExt) &&
716
- I && isa<LoadInst>(I->getOperand (0 ))) {
705
+ LLVM_FALLTHROUGH;
706
+ case Instruction::SExt: {
707
+ // If this is a zext/sext of a load, return 0 if the corresponding
708
+ // extending load exists on target.
709
+ if (I && isa<LoadInst>(I->getOperand (0 ))) {
717
710
EVT ExtVT = EVT::getEVT (Dst);
718
711
EVT LoadVT = EVT::getEVT (Src);
719
712
unsigned LType =
720
713
((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
721
714
if (TLI->isLoadExtLegal (LType, ExtVT, LoadVT))
722
715
return 0 ;
716
+ }
717
+ break ;
718
+ }
719
+ case Instruction::AddrSpaceCast:
720
+ if (TLI->isFreeAddrSpaceCast (Src->getPointerAddressSpace (),
721
+ Dst->getPointerAddressSpace ()))
722
+ return 0 ;
723
+ break ;
723
724
}
724
725
725
726
// If the cast is marked as legal (or promote) then assume low cost.
You can’t perform that action at this time.
0 commit comments