aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestJava.cpp
diff options
context:
space:
mode:
authorSjoerd Meijer <smeijer@nvidia.com>2025-10-20 10:23:36 +0100
committerGitHub <noreply@github.com>2025-10-20 10:23:36 +0100
commitb90a8d385e0d35a2e870aa7b4cf16ee37df10851 (patch)
tree02e535f864a29b7afa04e73a2597543183618123 /clang/unittests/Format/FormatTestJava.cpp
parenteb17a8d599dbcadecba2529dcf9ac234b085088a (diff)
downloadllvm-b90a8d385e0d35a2e870aa7b4cf16ee37df10851.zip
llvm-b90a8d385e0d35a2e870aa7b4cf16ee37df10851.tar.gz
llvm-b90a8d385e0d35a2e870aa7b4cf16ee37df10851.tar.bz2
[LoopInterchange] Add simplifyLCSSAPhis: remove phi from non-exit bb (#160889)
This deals with a corner case of LCSSA phi nodes in the outer loop latch block: the loop was in LCSSA form, some transformations can come along (e.g. unswitch) and create an empty block: BB4: br label %BB5 BB5: %old.cond.lcssa = phi i16 [ %cond, %BB4 ] br outer.header Interchange then brings it in LCSSA form again and we get: BB4: %new.cond.lcssa = phi i16 [ %cond, %BB3 ] br label %BB5 BB5: %old.cond.lcssa = phi i16 [ %new.cond.lcssa, %BB4 ] Which means that we have a chain of LCSSA phi nodes from %new.cond.lcssa to %old.cond.lcssa. The problem is that interchange can reoder blocks BB4 and BB5 placing the use before the def if we don't check this. The solution is to simplify lcssa phis, and remove them from non-exit blocks if they are 1-input phi nodes. Fixes #160068
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
0 files changed, 0 insertions, 0 deletions