Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit df8dbd5

Browse files
committed
Revert "Disable LLVM patches: 1-stripPointerCastsAndOffsets-should-not 2_2-completely-turn-off-code-sinking-in-InstructionCombining"
This reverts commit b259eb8. Change-Id: Ia2a23cd90c3481c8e09c10cedb4fddb2fac3c36e
1 parent b259eb8 commit df8dbd5

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Description : stripPointerCastsAndOffsets should not process across AddrSpaceCast
2+
3+
4+
diff -Naur --strip-trailing-cr a/lib/IR/Value.cpp b/lib/IR/Value.cpp
5+
--- a/lib/IR/Value.cpp 2016-12-07 13:47:32.000000000 -0800
6+
+++ b/lib/IR/Value.cpp 2018-03-12 11:25:42.752625100 -0700
7+
@@ -466,6 +466,11 @@
8+
V = GEP->getPointerOperand();
9+
} else if (Operator::getOpcode(V) == Instruction::BitCast ||
10+
Operator::getOpcode(V) == Instruction::AddrSpaceCast) {
11+
+ // Do not process across AddrSpaceCast, since its result could
12+
+ // be a nullptr depending on the meaning of src and dest addrspace.
13+
+ if (Operator::getOpcode(V) == Instruction::AddrSpaceCast) {
14+
+ return V;
15+
+ }
16+
V = cast<Operator>(V)->getOperand(0);
17+
} else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
18+
if (StripKind == PSK_ZeroIndices || GA->isInterposable())
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Description : completely turn off code-sinking in InstructionCombining.
2+
3+
4+
diff -Naur --strip-trailing-cr a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
5+
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp 2017-10-23 09:48:44.308224955 -0400
6+
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp 2017-10-23 09:49:06.404224089 -0400
7+
@@ -2871,7 +2871,9 @@
8+
}
9+
10+
// See if we can trivially sink this instruction to a successor basic block.
11+
- if (I->hasOneUse()) {
12+
+ /*** turn off code-sinking ***/
13+
+ /*** if (I->hasOneUse()) { ***/
14+
+ if (0) {
15+
BasicBlock *BB = I->getParent();
16+
Instruction *UserInst = cast<Instruction>(*I->user_begin());
17+
BasicBlock *UserParent;

0 commit comments

Comments
 (0)