As discussed in D93943, this patch fixes the UB issue by freezing the extra condition when optimizing
if(extracond || X == C1 || X == C2 || ...) into if(extracond) { switch(X) { .. } }.
Note that this transformation is safe if undef value is gone.
Paths
| Differential D94893
[SimplifyCFG] Freeze the extra condition when optimizing to switch AbandonedPublic Authored by aqjune on Jan 17 2021, 9:02 PM.
Details
Summary As discussed in D93943, this patch fixes the UB issue by freezing the extra condition when optimizing Note that this transformation is safe if undef value is gone.
Diff Detail
Event TimelineComment Actions Since this might affect the quality of generated assembly, I'll run experiment and see how it goes.
Revision Contents
Diff 317265 llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/switch_create-custom-dl.ll
llvm/test/Transforms/SimplifyCFG/switch_create.ll
llvm/test/Transforms/SimplifyCFG/switch_msan.ll
|
clang-format not found in user's PATH; not linting file.