Skip to content

Commit 863a8eb

Browse files
committed
move isTokenLikeTy check from to processLoad to capture all the processNonLocalLoad cases
1 parent e2ef66f commit 863a8eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,9 +1659,6 @@ bool GVNPass::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
16591659
// that we only have to insert *one* load (which means we're basically moving
16601660
// the load, not inserting a new one).
16611661

1662-
if (Load->getType()->isTokenLikeTy())
1663-
return false;
1664-
16651662
SmallPtrSet<BasicBlock *, 4> Blockers(llvm::from_range, UnavailableBlocks);
16661663

16671664
// Let's find the first basic block with more than one predecessor. Walk
@@ -2247,6 +2244,9 @@ bool GVNPass::processLoad(LoadInst *L) {
22472244
if (!L->isUnordered())
22482245
return false;
22492246

2247+
if (L->getType()->isTokenLikeTy())
2248+
return false;
2249+
22502250
if (L->use_empty()) {
22512251
salvageAndRemoveInstruction(L);
22522252
return true;

0 commit comments

Comments
 (0)