[all-commits] [llvm/llvm-project] 642587: [CostModel] Avoid traditional ConstantExpr crashy ...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Jun 26 12:49:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 64258773ad99b3b6a3eb2a456b79518c1444d9f3
      https://github.com/llvm/llvm-project/commit/64258773ad99b3b6a3eb2a456b79518c1444d9f3
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    A llvm/test/Transforms/SimplifyCFG/constantexprs.ll

  Log Message:
  -----------
  [CostModel] Avoid traditional ConstantExpr crashy pitfails

I'm not sure if this is a regression from D81448 + D81643,
which moved at least the code cast from elsewhere,
or somehow no one triggered that before.
But now we can reach it with a non-instruction..

It is not straight-forward to write cost-model tests for constantexprs,
`-cost-model -analyze -cost-kind=` does not appear to look at them,
or maybe i'm doing it wrong.

I've encountered that via a SimplifyCFG crash,
so reduced (currently-crashing) test is added.
There are likely other instances.

For now, simply restore previous status quo of
not crashing and returning TTI::TCC_Basic.




More information about the All-commits mailing list