[llvm] r228760 - EarlyCSE: It isn't safe to CSE across synchronization boundaries
David Majnemer
david.majnemer at gmail.com
Tue Feb 10 18:08:59 PST 2015
Hi Hans,
I think r228760 and r228761 should get merged into 3.6
On Tue, Feb 10, 2015 at 3:09 PM, David Majnemer <david.majnemer at gmail.com>
wrote:
> Author: majnemer
> Date: Tue Feb 10 17:09:43 2015
> New Revision: 228760
>
> URL: http://llvm.org/viewvc/llvm-project?rev=228760&view=rev
> Log:
> EarlyCSE: It isn't safe to CSE across synchronization boundaries
>
> This fixes PR22514.
>
> Modified:
> llvm/trunk/lib/Transforms/Scalar/EarlyCSE.cpp
> llvm/trunk/test/Transforms/EarlyCSE/basic.ll
>
> Modified: llvm/trunk/lib/Transforms/Scalar/EarlyCSE.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/EarlyCSE.cpp?rev=228760&r1=228759&r2=228760&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/EarlyCSE.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/EarlyCSE.cpp Tue Feb 10 17:09:43 2015
> @@ -527,6 +527,9 @@ bool EarlyCSE::processNode(DomTreeNode *
> // Ignore volatile loads.
> if (MemInst.isVolatile()) {
> LastStore = nullptr;
> + // Don't CSE across synchronization boundaries.
> + if (Inst->mayWriteToMemory())
> + ++CurrentGeneration;
> continue;
> }
>
>
> Modified: llvm/trunk/test/Transforms/EarlyCSE/basic.ll
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/EarlyCSE/basic.ll?rev=228760&r1=228759&r2=228760&view=diff
>
> ==============================================================================
> --- llvm/trunk/test/Transforms/EarlyCSE/basic.ll (original)
> +++ llvm/trunk/test/Transforms/EarlyCSE/basic.ll Tue Feb 10 17:09:43 2015
> @@ -193,4 +193,10 @@ define void @test11(i32 *%P) {
> ; CHECK-NEXT: ret void
> }
>
> -
> +define i32 @test12(i1 %B, i32* %P1, i32* %P2) {
> + %load0 = load i32* %P1
> + %1 = load atomic i32* %P2 seq_cst, align 4
> + %load1 = load i32* %P1
> + %sel = select i1 %B, i32 %load0, i32 %load1
> + ret i32 %sel
> +}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150210/51cfe554/attachment.html>
More information about the llvm-commits
mailing list