[PATCH] D119934: [RISCV] Fix a mistake in PostprocessISelDAG

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 18:08:21 PST 2022


jrtc27 added inline comments.


================
Comment at: llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll:198
+entry:
+  %cmp = icmp eq i32 %a, 0
+  br i1 %cmp, label %if.then, label %if.end
----------------
Unless you feed the IR through opt, this isn't actually needed, you can just have entry's contents be if.then. The key thing is the ret isn't in the same basic block as the store as that would otherwise be the root for everything with a chain. Maybe it's a good idea to keep the dummy compare though so it's safe against optimisation silently folding the ret back into the basic block, as passing this through opt as it stands does nothing.


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

https://reviews.llvm.org/D119934



More information about the llvm-commits mailing list