[PATCH] D119532: [RISCV] Extend sext.w removal pass to remove unused sign-extensions

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 11 08:53:06 PST 2022


craig.topper added inline comments.


================
Comment at: llvm/test/CodeGen/RISCV/sextw-removal.ll:506
+bb2:                                              ; preds = %bb2, %bb
+  %i1 = phi i64 [ %arg1, %entry ], [ %i5, %bb2 ]
+  %i2 = shl i64 %i1, 32
----------------
The loop calculate the same value every time. The loop optimizers in the middle can remove it.

Nothing about this test looks a problem that is unique to RISCV. The shifts are redundant on any target and are visible to the middle end. Why shouldn't we clean it up in the middle end?


================
Comment at: llvm/test/CodeGen/RISCV/sextw-removal.ll:520
+
+declare i64 @helper(i64)
----------------
This function is unused


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

https://reviews.llvm.org/D119532



More information about the llvm-commits mailing list