[llvm-bugs] [Bug 48321] New: [LoopVectorizer] getInstructionCost() triggers assert

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 28 03:43:08 PST 2020


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: unassignedbugs at nondot.org
          Reporter: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201128/eec6109d/attachment.html>


More information about the llvm-bugs mailing list