From: Geoff Berry Date: Wed, 16 Aug 2017 19:03:16 +0000 (+0000) Subject: [LoopDataPrefetch][AArch64FalkorHWPFFix] Preserve ScalarEvolution X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8410517a1dce8d432387c2c4869716c695f5ab1f;p=llvm [LoopDataPrefetch][AArch64FalkorHWPFFix] Preserve ScalarEvolution Summary: Mark LoopDataPrefetch and AArch64FalkorHWPFFix passes as preserving ScalarEvolution since they do not alter loop structure and should not alter any SCEV values (though LoopDataPrefetch may introduce new instructions that won't have cached SCEV values yet). This can result in slight code differences, mainly w.r.t. nsw/nuw flags on SCEVs, since these are computed somewhat lazily when a zext/sext instruction is encountered. As a result, passes after the modified passes may see SCEVs with more nsw/nuw flags present. Reviewers: sanjoy, anemet Subscribers: aemerson, rengolin, mzolotukhin, javed.absar, kristof.beyls, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D36716 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311032 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp b/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp index 4c429c76c3b..3dd82f648b1 100644 --- a/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp +++ b/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp @@ -92,9 +92,7 @@ public: AU.addRequired(); AU.addPreserved(); AU.addRequired(); - // FIXME: For some reason, preserving SE here breaks LSR (even if - // this pass changes nothing). - // AU.addPreserved(); + AU.addPreserved(); } bool runOnFunction(Function &F) override; diff --git a/lib/Transforms/Scalar/LoopDataPrefetch.cpp b/lib/Transforms/Scalar/LoopDataPrefetch.cpp index d09af32a99f..42dc38c37e0 100644 --- a/lib/Transforms/Scalar/LoopDataPrefetch.cpp +++ b/lib/Transforms/Scalar/LoopDataPrefetch.cpp @@ -120,9 +120,7 @@ public: AU.addPreserved(); AU.addRequired(); AU.addRequired(); - // FIXME: For some reason, preserving SE here breaks LSR (even if - // this pass changes nothing). - // AU.addPreserved(); + AU.addPreserved(); AU.addRequired(); }