[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. I'm not sure about that - we could tie instcombine to -O0 or some similar proxy for debugging ve performance - but I'm practice it's fairly likely that most traps are compiler inserted so it probably works out the same. Conditional instcombine would let us remov

[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert abandoned this revision. jdoerfert added a comment. Replaced by D106308 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106301/new/ https://reviews.llvm.org/D106301 ___

[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. In D106301#2888203 , @JonChesterfield wrote: > In D106301#2888170 , @jdoerfert > wrote: > >> llvm.trap is preserved, thus branches to an llvm.trap are preserved. > > That's interesting

[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. In D106301#2888170 , @jdoerfert wrote: > llvm.trap is preserved, thus branches to an llvm.trap are preserved. That's interesting. Consistent with IR in general, template int test(int x) { if (x < 42) { retur

[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. As an example, often end up with code like this right now: %26 = load i32, i32* addrspacecast (i32 addrspace(3)* @execution_param to i32*), align 4, !dbg !39, !tbaa !27 %and.i13.i.i = and i32 %26, 4, !dbg !39 %cmp.i14.not.i.i = icmp eq i32 %and.i13.i.i, 0,

[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. In D106301#2888162 , @JonChesterfield wrote: > What's the problem with emitting llvm.trap in various unreachable places? llvm.trap is preserved, thus branches to an llvm.trap are preserved. > Wondering if it also affects tran

[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 359882. jdoerfert added a comment. Fix copy&paste error Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106301/new/ https://reviews.llvm.org/D106301 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/

[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. What's the problem with emitting llvm.trap in various unreachable places? Wondering if it also affects translating assert to an llvm.trap Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106301/new/ https://reviews.ll

[PATCH] D106301: [OpenMP] Disable trap before unreachable for OpenMP device jobs

2021-07-19 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert created this revision. jdoerfert added reviewers: jhuber6, tianshilei1992, JonChesterfield. Herald added subscribers: guansong, bollu, yaxunl. jdoerfert requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. We want to fold more