[PATCH] D127699: [InstCombine] Don't slice up PHIs when pred BB has catchswitch
Heejin Ahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 13 17:02:32 PDT 2022
aheejin added inline comments.
================
Comment at: llvm/test/Transforms/InstCombine/catchswitch-phi.ll:95
+ ; InstCombine and the pass shouldn't produce invalid code.
+ ; CHECK: catch.dispatch:
+ ; CHECK-NEXT: phi
----------------
dschuff wrote:
> So, does the IR verifier check the property that catchswitches can't have any non-PHIs? would that be sufficient to check this?
> Not that I'm suggesting you change this, it's a simple condition and I don't really expect it to be brittle. Mostly I'm just wondering how this escaped and what made the resulting error not obvious.
I don't think the IR verifier runs after every pass unless you pass some option, so this pass produced an invalid IR, and that caused the crash in the inliner. But it seems `opt` at least checks the validity at the end, so if you run only `-instcombine` and if it produces an invalid IR, it will crash.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127699/new/
https://reviews.llvm.org/D127699
More information about the llvm-commits
mailing list