diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-10-20 01:06:31 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-10-20 01:06:31 +0000 |
commit | 3020b1bc8c9f833077470016a47b917aaab1ebbf (patch) | |
tree | b0d68b2680f912ffc241a2bdd544c83ad9f4366d /llvm/lib | |
parent | b1942f14cd2b933d618efbc2521f342fffde7589 (diff) | |
download | bcm5719-llvm-3020b1bc8c9f833077470016a47b917aaab1ebbf.tar.gz bcm5719-llvm-3020b1bc8c9f833077470016a47b917aaab1ebbf.zip |
[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`.
llvm-svn: 250786
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 2001b071f78..6be71dc3d94 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -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( |