[llvm] [Codegen][LegalizeIntegerTypes] Improve shift through stack (PR #96151)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 06:12:58 PDT 2024


================
@@ -179,21 +179,36 @@ define void @ashr_16bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
 define void @lshr_32bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
 ; ALL-LABEL: lshr_32bytes:
 ; ALL:       // %bb.0:
-; ALL-NEXT:    sub sp, sp, #64
-; ALL-NEXT:    ldp x9, x8, [x0, #16]
-; ALL-NEXT:    movi v0.2d, #0000000000000000
+; ALL-NEXT:    ldr q0, [x0]
----------------
futog wrote:

the reason of the regression is that in the legacy the shift unit was 1 byte, and in this test the shift is a multiple of 1 byte, so we could figure out that the shift will be one load only.

Now the shift unit is 8 byte, so the shift will be load + shift


https://github.com/llvm/llvm-project/pull/96151


More information about the llvm-commits mailing list