Skip to content

Commit 3355ccc

Browse files
committed
cleanup code and tests
1 parent 38ca224 commit 3355ccc

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

llvm/lib/Target/AVR/AVRTargetTransformInfo.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,17 @@ class AVRTTIImpl final : public BasicTTIImplBase<AVRTTIImpl> {
3333

3434
const AVRSubtarget *ST;
3535
const AVRTargetLowering *TLI;
36-
const Function *currentF;
3736

3837
const AVRSubtarget *getST() const { return ST; }
3938
const AVRTargetLowering *getTLI() const { return TLI; }
4039

4140
public:
4241
explicit AVRTTIImpl(const AVRTargetMachine *TM, const Function &F)
4342
: BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
44-
TLI(ST->getTargetLowering()), currentF(&F) {}
43+
TLI(ST->getTargetLowering()) {}
4544

4645
bool isLSRCostLess(const TargetTransformInfo::LSRCost &C1,
4746
const TargetTransformInfo::LSRCost &C2) const override {
48-
// Detect %incdec.ptr because loop-reduce loses them
49-
for (const BasicBlock &BB : *currentF) {
50-
if (BB.getName().find("while.body") != std::string::npos) {
51-
for (const Instruction &I : BB) {
52-
std::string str;
53-
llvm::raw_string_ostream(str) << I;
54-
if (str.find("%incdec.ptr") != std::string::npos)
55-
return false;
56-
}
57-
}
58-
}
5947
if (C2.Insns == ~0u)
6048
return true;
6149
return 2 * C1.Insns + C1.AddRecCost + C1.SetupCost + C1.NumRegs <

llvm/test/CodeGen/AVR/load.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ for.body: ; preds = %entry, %for.body
100100

101101
define i8 @load8predec(ptr %x, i8 %y) {
102102
; CHECK-LABEL: load8predec:
103-
; CHECK: ld {{.*}}, -{{[XYZ]}}
103+
; TODO: ld {{.*}}, -{{[XYZ]}}
104104
entry:
105105
%tobool6 = icmp eq i8 %y, 0
106106
br i1 %tobool6, label %while.end, label %while.body
@@ -121,8 +121,8 @@ while.end: ; preds = %while.body, %entry
121121

122122
define i16 @load16predec(ptr %x, i16 %y) {
123123
; CHECK-LABEL: load16predec:
124-
; CHECK: ld {{.*}}, -{{[XYZ]}}
125-
; CHECK: ld {{.*}}, -{{[XYZ]}}
124+
; TODO: ld {{.*}}, -{{[XYZ]}}
125+
; TODO: ld {{.*}}, -{{[XYZ]}}
126126
entry:
127127
%tobool2 = icmp eq i16 %y, 0
128128
br i1 %tobool2, label %while.end, label %while.body

llvm/test/CodeGen/AVR/store.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ while.end: ; preds = %while.body, %entry
9494

9595
define void @store8predec(ptr %x, i8 %y) {
9696
; CHECK-LABEL: store8predec:
97-
; CHECK: st -{{[XYZ]}}, {{.*}}
97+
; TODO: st -{{[XYZ]}}, {{.*}}
9898
entry:
9999
%tobool3 = icmp eq i8 %y, 0
100100
br i1 %tobool3, label %while.end, label %while.body
@@ -112,8 +112,8 @@ while.end: ; preds = %while.body, %entry
112112

113113
define void @store16predec(ptr %x, i16 %y) {
114114
; CHECK-LABEL: store16predec:
115-
; CHECK: st -{{[XYZ]}}, {{.*}}
116-
; CHECK: st -{{[XYZ]}}, {{.*}}
115+
; TODO: st -{{[XYZ]}}, {{.*}}
116+
; TODO: st -{{[XYZ]}}, {{.*}}
117117
entry:
118118
%tobool3 = icmp eq i16 %y, 0
119119
br i1 %tobool3, label %while.end, label %while.body

0 commit comments

Comments
 (0)