[PATCH] D127699: [InstCombine] Don't slice up PHIs when pred BB has catchswitch

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 16:37:48 PDT 2022


dschuff accepted this revision.
dschuff added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/test/Transforms/InstCombine/catchswitch-phi.ll:60
+
+; Test if slicing-up of illegal integer type PHI does not happen in catchswitch
+; BBs, which can't have any non-PHI instruction before the catchswitch.
----------------



================
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
----------------
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.


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