Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

JL #74

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open

JL #74

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
75e093b
Creating release_70 branch off revision 338536
zmodem Aug 1, 2018
02181d6
Drop 'svn' suffix from the version number.
zmodem Aug 1, 2018
3332f06
Merging r338658:
zmodem Aug 2, 2018
9dbe7c7
Merging r338682:
zmodem Aug 2, 2018
d030aee
Merging r338554:
zmodem Aug 2, 2018
4f6e104
Release notes: fix -fno-strict-float-cast-overflow quoting
zmodem Aug 2, 2018
9cc4d9e
Merging r338703 and r338709:
zmodem Aug 3, 2018
5aa2b5a
Merging r338751:
zmodem Aug 3, 2018
ed621a5
Merging r338762:
zmodem Aug 3, 2018
731482e
Merging r338599:
zmodem Aug 3, 2018
491b046
Release note for DWARF v5 support
pogo59 Aug 3, 2018
1a7200c
Merging r338817:
zmodem Aug 7, 2018
7fe11a1
Merging r338665:
zmodem Aug 7, 2018
9d9705f
Merging r338968:
zmodem Aug 7, 2018
7afafa5
Merging r338569:
zmodem Aug 7, 2018
07e3ee9
Merging r338610:
zmodem Aug 7, 2018
c5aadce
Merging r338915:
zmodem Aug 7, 2018
7205f34
ReleaseNotes: the new vs integration
zmodem Aug 7, 2018
b87385f
Merging r338716:
zmodem Aug 8, 2018
62ca9ef
Merging r339190:
zmodem Aug 8, 2018
f208a0a
Merging r338902:
zmodem Aug 8, 2018
ef7dd70
Merging r339319:
zmodem Aug 9, 2018
f7ec630
Merging r339316:
zmodem Aug 9, 2018
387b5e3
[7.0 branch] Update release notes (SystemZ, TableGen)
uweigand Aug 9, 2018
c7b3270
Merging r339225:
zmodem Aug 13, 2018
5a09a6b
Merging r339073:
zmodem Aug 13, 2018
c2e9eb3
Merging r339179 and r339184:
zmodem Aug 13, 2018
b4d5f64
Merging r339492:
zmodem Aug 13, 2018
18c17c4
Merging r339411:
zmodem Aug 13, 2018
1415ff0
[ReleaseNotes] Mention various windows related changes in 7.0
mstorsjo Aug 14, 2018
9360946
Merging r339600:
zmodem Aug 14, 2018
36b087d
Merging r339636:
rnk Aug 14, 2018
12eb6bc
[ReleaseNotes] Add release notes for Hexagon
Aug 14, 2018
ef7c5cc
[ReleaseNotes] Fix a typo
Aug 14, 2018
8684e0b
Merging r339166:
zmodem Aug 16, 2018
0caaac0
Merging r339533:
zmodem Aug 16, 2018
bb6ad81
Merging r339535:
zmodem Aug 16, 2018
f6ce3c5
Merging r339536:
zmodem Aug 16, 2018
2c9adfa
Merging r339769:
zmodem Aug 16, 2018
02e459e
Merging r339515:
zmodem Aug 17, 2018
e7782a9
Merging r339883:
zmodem Aug 17, 2018
dff83e9
Merging r339945:
zmodem Aug 17, 2018
98aa61b
Merging r338841:
zmodem Aug 17, 2018
39ee064
Merging r339822:
zmodem Aug 21, 2018
1215ec5
Merging r339895 and r339896:
zmodem Aug 21, 2018
9a7960e
Merging r339091:
zmodem Aug 21, 2018
fbe3346
Merging r340158:
zmodem Aug 21, 2018
57aa5d9
Merging r339674:
zmodem Aug 21, 2018
9df0977
Merging r340303:
zmodem Aug 21, 2018
4a4bff5
Merging r340691:
zmodem Aug 27, 2018
d6e617b
Merging r340641:
zmodem Aug 27, 2018
3d019e2
Merging r340839:
zmodem Aug 30, 2018
4a19487
Merging r340820:
zmodem Aug 30, 2018
400322b
Merging r340455:
zmodem Aug 30, 2018
8be2375
Merging r340416:
zmodem Aug 30, 2018
9f22831
Merging r340417:
zmodem Aug 30, 2018
c19f813
Merging r340751:
zmodem Aug 30, 2018
224408d
Merging r340900:
zmodem Aug 30, 2018
485d211
[docs][mips] 7.0 Release notes
atanasyan Aug 31, 2018
8be5c4f
Merging r341094:
zmodem Aug 31, 2018
1a55853
Merging r341244:
zmodem Sep 4, 2018
8111e8d
Merging r340959:
zmodem Sep 4, 2018
600f7a2
ReleaseNotes for PowerPC
zmodem Sep 5, 2018
738f19a
ReleaseNotes: support for new-pm passes in the opt tool
zmodem Sep 6, 2018
80cc9fc
ReleaseNotes: ARM SVE asm/disasm support
zmodem Sep 6, 2018
033c772
Merging r341416:
zmodem Sep 6, 2018
a5b9a59
Merging r341512:
zmodem Sep 6, 2018
cd197f3
ReleaseNotes: tidy up for the release
zmodem Sep 7, 2018
4a05921
Merging r341642:
zmodem Sep 10, 2018
82250ed
ReleaseNotes: minor tweaks
zmodem Sep 10, 2018
0d41278
docs: drop another in-progress warning
zmodem Sep 10, 2018
627a2d5
ReleaseNotes.rst: Add Zig to External Open Source Projects Using LLVM 7
zmodem Sep 11, 2018
65ce2e5
ReleaseNotes: some notes from Andres Freund
zmodem Sep 11, 2018
6c2e5a1
Merging r343347:
tstellar Oct 19, 2018
9a0352f
Merging r343443:
tstellar Oct 19, 2018
b2504ea
Merging r343428:
tstellar Oct 19, 2018
888225e
Merging r343373:
tstellar Oct 19, 2018
eb0722e
Merging r342461:
tstellar Oct 22, 2018
4c946b7
Merging r344325:
tstellar Oct 26, 2018
5ab8235
Merging r344454, r344455, r344645:
tstellar Nov 2, 2018
2e8411d
Merging r342354:
tstellar Nov 2, 2018
d0abf8b
Bump version to 7.0.1
tstellar Nov 2, 2018
b386e8b
Port Memoro to LLVM 7.0
ttreyer Nov 7, 2018
076c3f5
removing unneeded code from memoro instrumentation pass, other commen…
Dec 12, 2018
65dac8b
removing tool options in memoro instrumentation, it was a relic and w…
Dec 13, 2018
9720d28
Formatting
ttreyer Jan 6, 2019
35c5877
Merge branch 'memoro' into memoro_80
ttreyer Jan 6, 2019
4113dff
Cleanup the merge
ttreyer Jan 6, 2019
ca9d68c
Fix memoro to skip alloca-referencing loads/stores
jameslarus Aug 16, 2019
bc3f246
Properly handle global variables and unknown refs.
jameslarus Aug 16, 2019
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merging r341642:
------------------------------------------------------------------------
r341642 | tnorthover | 2018-09-07 11:21:25 +0200 (Fri, 07 Sep 2018) | 8 lines

ARM: fix Thumb2 CodeGen for ldrex with folded frame-index.

Because t2LDREX (& t2STREX) were marked as AddrModeNone, but did allow a
FrameIndex operand, rewriteT2FrameIndex asserted. This gives them a
proper addressing-mode and tells the rewriter about it so that encodable
offsets are exploited and others are rejected.

Should fix PR38828.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_70@341783 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
zmodem committed Sep 10, 2018
commit 4a059213dd6f034147e9083c21133dc1b57b3a8a
1 change: 1 addition & 0 deletions lib/Target/ARM/ARMFrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,7 @@ static unsigned estimateRSStackSizeLimit(MachineFunction &MF,
break;
case ARMII::AddrMode5:
case ARMII::AddrModeT2_i8s4:
case ARMII::AddrModeT2_ldrex:
Limit = std::min(Limit, ((1U << 8) - 1) * 4);
break;
case ARMII::AddrModeT2_i12:
Expand Down
1 change: 1 addition & 0 deletions lib/Target/ARM/ARMInstrFormats.td
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def AddrModeT2_pc : AddrMode<14>;
def AddrModeT2_i8s4 : AddrMode<15>;
def AddrMode_i12 : AddrMode<16>;
def AddrMode5FP16 : AddrMode<17>;
def AddrModeT2_ldrex : AddrMode<18>;

// Load / store index mode.
class IndexMode<bits<2> val> {
Expand Down
4 changes: 2 additions & 2 deletions lib/Target/ARM/ARMInstrThumb2.td
Original file line number Diff line number Diff line change
Expand Up @@ -3267,7 +3267,7 @@ def t2LDREXH : T2I_ldrex<0b0101, (outs rGPR:$Rt), (ins addr_offset_none:$addr),
[(set rGPR:$Rt, (ldrex_2 addr_offset_none:$addr))]>,
Requires<[IsThumb, HasV8MBaseline]>;
def t2LDREX : Thumb2I<(outs rGPR:$Rt), (ins t2addrmode_imm0_1020s4:$addr),
AddrModeNone, 4, NoItinerary,
AddrModeT2_ldrex, 4, NoItinerary,
"ldrex", "\t$Rt, $addr", "",
[(set rGPR:$Rt, (ldrex_4 t2addrmode_imm0_1020s4:$addr))]>,
Requires<[IsThumb, HasV8MBaseline]> {
Expand Down Expand Up @@ -3346,7 +3346,7 @@ def t2STREXH : T2I_strex<0b0101, (outs rGPR:$Rd),

def t2STREX : Thumb2I<(outs rGPR:$Rd), (ins rGPR:$Rt,
t2addrmode_imm0_1020s4:$addr),
AddrModeNone, 4, NoItinerary,
AddrModeT2_ldrex, 4, NoItinerary,
"strex", "\t$Rd, $Rt, $addr", "",
[(set rGPR:$Rd,
(strex_4 rGPR:$Rt, t2addrmode_imm0_1020s4:$addr))]>,
Expand Down
4 changes: 3 additions & 1 deletion lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ namespace ARMII {
AddrModeT2_pc = 14, // +/- i12 for pc relative data
AddrModeT2_i8s4 = 15, // i8 * 4
AddrMode_i12 = 16,
AddrMode5FP16 = 17 // i8 * 2
AddrMode5FP16 = 17, // i8 * 2
AddrModeT2_ldrex = 18, // i8 * 4, with unscaled offset in MCInst
};

inline static const char *AddrModeToString(AddrMode addrmode) {
Expand All @@ -224,6 +225,7 @@ namespace ARMII {
case AddrModeT2_pc: return "AddrModeT2_pc";
case AddrModeT2_i8s4: return "AddrModeT2_i8s4";
case AddrMode_i12: return "AddrMode_i12";
case AddrModeT2_ldrex:return "AddrModeT2_ldrex";
}
}

Expand Down
5 changes: 5 additions & 0 deletions lib/Target/ARM/Thumb2InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,11 @@ bool llvm::rewriteT2FrameIndex(MachineInstr &MI, unsigned FrameRegIdx,
// MCInst operand expects already scaled value.
Scale = 1;
assert((Offset & 3) == 0 && "Can't encode this offset!");
} else if (AddrMode == ARMII::AddrModeT2_ldrex) {
Offset += MI.getOperand(FrameRegIdx + 1).getImm() * 4;
NumBits = 8; // 8 bits scaled by 4
Scale = 4;
assert((Offset & 3) == 0 && "Can't encode this offset!");
} else {
llvm_unreachable("Unsupported addressing mode!");
}
Expand Down
36 changes: 36 additions & 0 deletions test/CodeGen/ARM/ldrex-frame-size.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
; RUN: llc -mtriple=thumbv7-linux-gnueabi -o - %s | FileCheck %s

; This alloca is just large enough that FrameLowering decides it needs a frame
; to guarantee access, based on the range of ldrex.

; The actual alloca size is a bit of black magic, unfortunately: the real
; maximum accessible is 1020, but FrameLowering adds 16 bytes to its estimated
; stack size just because so the alloca is not actually the what the limit gets
; compared to. The important point is that we don't go up to ~4096, which is the
; default with no strange instructions.
define void @test_large_frame() {
; CHECK-LABEL: test_large_frame:
; CHECK: push
; CHECK: sub.w sp, sp, #1004

%ptr = alloca i32, i32 251

%addr = getelementptr i32, i32* %ptr, i32 1
call i32 @llvm.arm.ldrex.p0i32(i32* %addr)
ret void
}

; This alloca is just is just the other side of the limit, so no frame
define void @test_small_frame() {
; CHECK-LABEL: test_small_frame:
; CHECK-NOT: push
; CHECK: sub.w sp, sp, #1000

%ptr = alloca i32, i32 250

%addr = getelementptr i32, i32* %ptr, i32 1
call i32 @llvm.arm.ldrex.p0i32(i32* %addr)
ret void
}

declare i32 @llvm.arm.ldrex.p0i32(i32*)
85 changes: 85 additions & 0 deletions test/CodeGen/ARM/ldstrex.ll
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,91 @@ define void @excl_addrmode() {
ret void
}

define void @test_excl_addrmode_folded() {
; CHECK-LABEL: test_excl_addrmode_folded:
%local = alloca i8, i32 4096

%local.0 = getelementptr i8, i8* %local, i32 4
%local32.0 = bitcast i8* %local.0 to i32*
call i32 @llvm.arm.ldrex.p0i32(i32* %local32.0)
call i32 @llvm.arm.strex.p0i32(i32 0, i32* %local32.0)
; CHECK-T2ADDRMODE: ldrex {{r[0-9]+}}, [sp, #4]
; CHECK-T2ADDRMODE: strex {{r[0-9]+}}, {{r[0-9]+}}, [sp, #4]

%local.1 = getelementptr i8, i8* %local, i32 1020
%local32.1 = bitcast i8* %local.1 to i32*
call i32 @llvm.arm.ldrex.p0i32(i32* %local32.1)
call i32 @llvm.arm.strex.p0i32(i32 0, i32* %local32.1)
; CHECK-T2ADDRMODE: ldrex {{r[0-9]+}}, [sp, #1020]
; CHECK-T2ADDRMODE: strex {{r[0-9]+}}, {{r[0-9]+}}, [sp, #1020]

ret void
}

define void @test_excl_addrmode_range() {
; CHECK-LABEL: test_excl_addrmode_range:
%local = alloca i8, i32 4096

%local.0 = getelementptr i8, i8* %local, i32 1024
%local32.0 = bitcast i8* %local.0 to i32*
call i32 @llvm.arm.ldrex.p0i32(i32* %local32.0)
call i32 @llvm.arm.strex.p0i32(i32 0, i32* %local32.0)
; CHECK-T2ADDRMODE: mov r[[TMP:[0-9]+]], sp
; CHECK-T2ADDRMODE: add.w r[[ADDR:[0-9]+]], r[[TMP]], #1024
; CHECK-T2ADDRMODE: ldrex {{r[0-9]+}}, [r[[ADDR]]]
; CHECK-T2ADDRMODE: strex {{r[0-9]+}}, {{r[0-9]+}}, [r[[ADDR]]]

ret void
}

define void @test_excl_addrmode_align() {
; CHECK-LABEL: test_excl_addrmode_align:
%local = alloca i8, i32 4096

%local.0 = getelementptr i8, i8* %local, i32 2
%local32.0 = bitcast i8* %local.0 to i32*
call i32 @llvm.arm.ldrex.p0i32(i32* %local32.0)
call i32 @llvm.arm.strex.p0i32(i32 0, i32* %local32.0)
; CHECK-T2ADDRMODE: mov r[[ADDR:[0-9]+]], sp
; CHECK-T2ADDRMODE: adds r[[ADDR:[0-9]+]], #2
; CHECK-T2ADDRMODE: ldrex {{r[0-9]+}}, [r[[ADDR]]]
; CHECK-T2ADDRMODE: strex {{r[0-9]+}}, {{r[0-9]+}}, [r[[ADDR]]]

ret void
}

define void @test_excl_addrmode_sign() {
; CHECK-LABEL: test_excl_addrmode_sign:
%local = alloca i8, i32 4096

%local.0 = getelementptr i8, i8* %local, i32 -4
%local32.0 = bitcast i8* %local.0 to i32*
call i32 @llvm.arm.ldrex.p0i32(i32* %local32.0)
call i32 @llvm.arm.strex.p0i32(i32 0, i32* %local32.0)
; CHECK-T2ADDRMODE: mov r[[ADDR:[0-9]+]], sp
; CHECK-T2ADDRMODE: subs r[[ADDR:[0-9]+]], #4
; CHECK-T2ADDRMODE: ldrex {{r[0-9]+}}, [r[[ADDR]]]
; CHECK-T2ADDRMODE: strex {{r[0-9]+}}, {{r[0-9]+}}, [r[[ADDR]]]

ret void
}

define void @test_excl_addrmode_combination() {
; CHECK-LABEL: test_excl_addrmode_combination:
%local = alloca i8, i32 4096
%unused = alloca i8, i32 64

%local.0 = getelementptr i8, i8* %local, i32 4
%local32.0 = bitcast i8* %local.0 to i32*
call i32 @llvm.arm.ldrex.p0i32(i32* %local32.0)
call i32 @llvm.arm.strex.p0i32(i32 0, i32* %local32.0)
; CHECK-T2ADDRMODE: ldrex {{r[0-9]+}}, [sp, #68]
; CHECK-T2ADDRMODE: strex {{r[0-9]+}}, {{r[0-9]+}}, [sp, #68]

ret void
}


; LLVM should know, even across basic blocks, that ldrex is setting the high
; bits of its i32 to 0. There should be no zero-extend operation.
define zeroext i8 @test_cross_block_zext_i8(i1 %tst, i8* %addr) {
Expand Down