Skip to content

Commit 95821a8

Browse files
author
chengcang.yang
committed
[TMP]
1 parent a1664e5 commit 95821a8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,8 @@ class SeparateConstOffsetFromGEP {
456456
/// A helper that reunites sexts in an instruction.
457457
bool reuniteExts(Instruction *I);
458458

459+
bool sinkGEPConstantOffset(Function &F);
460+
459461
/// Find the closest dominator of <Dominatee> that is equivalent to <Key>.
460462
Instruction *findClosestMatchingDominator(
461463
ExprKey Key, Instruction *Dominatee,
@@ -1255,6 +1257,8 @@ bool SeparateConstOffsetFromGEP::run(Function &F) {
12551257

12561258
Changed |= reuniteExts(F);
12571259

1260+
Changed |= sinkGEPConstantOffset(F);
1261+
12581262
if (VerifyNoDeadCode)
12591263
verifyNoDeadCode(F);
12601264

@@ -1344,6 +1348,17 @@ bool SeparateConstOffsetFromGEP::reuniteExts(Function &F) {
13441348
return Changed;
13451349
}
13461350

1351+
bool SeparateConstOffsetFromGEP::sinkGEPConstantOffset(Function &F) {
1352+
bool Changed = false;
1353+
for (BasicBlock &B : F) {
1354+
for (Instruction &I : B) {
1355+
1356+
}
1357+
}
1358+
1359+
return Changed;
1360+
}
1361+
13471362
void SeparateConstOffsetFromGEP::verifyNoDeadCode(Function &F) {
13481363
for (BasicBlock &B : F) {
13491364
for (Instruction &I : B) {

0 commit comments

Comments
 (0)