[RS4GC] Remove a redundant linear search, NFCI

Since LiveVariables is uniqued (we just created it from a `DenseSet`),
`FindIndex(LiveVariables, LiveVariables[i])` is always `i`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250786 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjoy Das 2015-10-20 01:06:31 +00:00
parent 3d31aca999
commit 35072eb786

View File

@ -1342,8 +1342,7 @@ static void CreateGCRelocates(ArrayRef<Value *> LiveVariables,
// Generate the gc.relocate call and save the result
Value *BaseIdx =
Builder.getInt32(LiveStart + FindIndex(LiveVariables, BasePtrs[i]));
Value *LiveIdx =
Builder.getInt32(LiveStart + FindIndex(LiveVariables, LiveVariables[i]));
Value *LiveIdx = Builder.getInt32(LiveStart + i);
// only specify a debug name if we can give a useful one
CallInst *Reloc = Builder.CreateCall(