[PATCH] D75801: [InstCombine] Remove known bits constant folding (WIP)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 8 01:06:16 PST 2020


nikic marked an inline comment as done.
nikic added inline comments.


================
Comment at: test/Transforms/InstCombine/assume.ll:340
+; CHECK-NEXT:    tail call void @llvm.assume(i1 [[CMP2]])
+; CHECK-NEXT:    ret i32 0
 ;
----------------
jdoerfert wrote:
> nikic wrote:
> > I'm not sure we really need to do anything about this, I think it's only important that we have an assume(false) here, and SimplifyCFG will deal with the rest.
> > 
> > If we do want to improve on this, we could convert assume(false) into store undef (the InstCombine UB pattern) and then remove all instructions after store undef.
> Can't we replace the UB instruction with unreachable?
InstCombine preserves CFG, so it's not possible to use unreachable directly. Instead we need to use UB patterns understood by SimplifyCFG (assume false is one of them), which will convert them to proper unreachable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75801/new/

https://reviews.llvm.org/D75801





More information about the llvm-commits mailing list