From 39bd1f66ebd83185944cf08903d8abf80321c17d Mon Sep 17 00:00:00 2001 From: Karl Schimpf Date: Fri, 2 Aug 2013 13:32:27 -0700 Subject: Remove unnecessary pointer casts on store instructions. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3544 R=mseaborn@chromium.org Review URL: https://codereview.chromium.org/21964002 --- lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp') diff --git a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp index 11e1161bf8..34f4f2bbe9 100644 --- a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp +++ b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp @@ -443,7 +443,12 @@ static bool AllowsNormalizedPtr(const Value *V, const Instruction *Arg) { default: return false; case Instruction::Load: + // Verify it is the ptr argument of the load. Note: This check is + // not really necessary in that a load only has one argument. return I->getOperand(0) == Arg; + case Instruction::Store: + // Verify it is the ptr argument of the store. + return I->getOperand(1) == Arg; } } -- cgit v1.2.3-70-g09d2