File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -9772,9 +9772,10 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) {
97729772 MemVT))
97739773 return SDValue();
97749774
9775- auto IsRotateLoaded = [](
9776- ArrayRef<int64_t> ByteOffsets, int64_t FirstOffset, unsigned BitWidth) {
9777- // Ensure that we have the correct width type, we want to combine two 32 loads into a 64 bit load.
9775+ auto IsRotateLoaded = [](ArrayRef<int64_t> ByteOffsets, int64_t FirstOffset,
9776+ unsigned BitWidth) {
9777+ // Ensure that we have the correct width type, we want to combine two 32
9778+ // loads into a 64 bit load.
97789779 if (BitWidth != 64 || ByteOffsets.size() != 8)
97799780 return false;
97809781
@@ -9795,13 +9796,13 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) {
97959796 // little endian value load
97969797 std::optional<bool> IsBigEndian = isBigEndian(
97979798 ArrayRef(ByteOffsets).drop_back(ZeroExtendedBytes), FirstOffset);
9798-
9799+
97999800 bool IsRotated = false;
98009801 if (!IsBigEndian) {
98019802 IsRotated =
9802- IsRotateLoaded(ArrayRef(ByteOffsets).drop_back(ZeroExtendedBytes),
9803- FirstOffset, VT.getSizeInBits());
9804-
9803+ IsRotateLoaded(ArrayRef(ByteOffsets).drop_back(ZeroExtendedBytes),
9804+ FirstOffset, VT.getSizeInBits());
9805+
98059806 if (!IsRotated)
98069807 return SDValue();
98079808 }
Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ define i64 @test_load_bswap_to_rotate(ptr %p) {
1010; CHECK-NEXT: movq (%rdi), %rax
1111; CHECK-NEXT: rorq $32, %rax
1212; CHECK-NEXT: retq
13- ;
14- ; CHECK-NOT: movl
1513
1614 %p.hi = getelementptr inbounds nuw i8 , ptr %p , i64 4
1715 %lo = load i32 , ptr %p
You can’t perform that action at this time.
0 commit comments