File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
llvm/lib/Transforms/Scalar Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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+
13471362void SeparateConstOffsetFromGEP::verifyNoDeadCode (Function &F) {
13481363 for (BasicBlock &B : F) {
13491364 for (Instruction &I : B) {
You can’t perform that action at this time.
0 commit comments