https://bugs.llvm.org/show_bug.cgi?id=48321

            Bug ID: 48321
           Summary: [LoopVectorizer]  getInstructionCost() triggers assert
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedb...@nondot.org
          Reporter: pauls...@linux.vnet.ibm.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 24216
  --> https://bugs.llvm.org/attachment.cgi?id=24216&action=edit
reduced testcase

LoopVectorizationCostModel::getInstructionCost is passed a trunc instruction:

%i11.i = trunc i40 %i10.i to i32

RetTy is first i32, but after

if (canTruncateToMinimalBitwidth(I, VF))
    RetTy = IntegerType::get(RetTy->getContext(), MinBWs[I]);

it is set to i1, which seems broken?

SystemZTTIImpl::getCastInstrCost() is then called:
(gdb) p Dst->dump()
<2 x i32>
$49 = void
(gdb) p Src->dump()
<2 x i1>

which triggers an assert since this would be a cost of truncating i1 vector to
i32 vector, which doesn't make sense...

./bin/opt -mcpu=z14 tc_sztti.ll -o a.out -O2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to