SuccessChanges

Summary

  1. [ASTImporter] Attempt to fix Windows buildbot test errors
  2. [libc++] Mark CTAD tests as not failing on AppleClang 10.0.1 They do fail on AppleClang 10.0.0, but not AppleClang 10.0.1
  3. NFC: Fix a poorly-written test The author of r364954 foolishly forgot that == binds tighter than ?:
  4. [InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563) Summary: If we have a pattern `(x & (-1 >> maskNbits)) << shiftNbits`, we already know (have a fold) that will drop the `& (-1 >> maskNbits)` mask iff `(shiftNbits-maskNbits) s>= 0` (i.e. `shiftNbits u>= maskNbits`). So even if `(shiftNbits-maskNbits) s< 0`, we can still fold, we will just need to apply a **constant** mask afterwards: ``` Name: c, normal+mask %t0 = lshr i32 -1, C1 %t1 = and i32 %t0, %x %r = shl i32 %t1, C2 => %n0 = shl i32 %x, C2 %n1 = i32 ((-(C2-C1))+32) %n2 = zext i32 %n1 to i64 %n3 = lshr i64 -1, %n2 %n4 = trunc i64 %n3 to i32 %r = and i32 %n0, %n4 ``` https://rise4fun.com/Alive/gslRa Naturally, old `%masked` will have to be one-use. This is not valid for pattern f - where "masking" is done via `ashr`. https://bugs.llvm.org/show_bug.cgi?id=42563 Reviewers: spatel, nikic, xbolva00 Reviewed By: spatel Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67725
  5. [InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563) Summary: And this is **finally** the interesting part of that fold! If we have a pattern `(x & (~(-1 << maskNbits))) << shiftNbits`, we already know (have a fold) that will drop the `& (~(-1 << maskNbits))` mask iff `(maskNbits+shiftNbits) u>= bitwidth(x)`. But that is actually ignorant, there's more general fold here: In this pattern, `(maskNbits+shiftNbits)` actually correlates with the number of low bits that will remain in the final value. So even if `(maskNbits+shiftNbits) u< bitwidth(x)`, we can still fold, we will just need to apply a **constant** mask afterwards: ``` Name: a, normal+mask %onebit = shl i32 -1, C1 %mask = xor i32 %onebit, -1 %masked = and i32 %mask, %x %r = shl i32 %masked, C2 => %n0 = shl i32 %x, C2 %n1 = add i32 C1, C2 %n2 = zext i32 %n1 to i64 %n3 = shl i64 -1, %n2 %n4 = xor i64 %n3, -1 %n5 = trunc i64 %n4 to i32 %r = and i32 %n0, %n5 ``` https://rise4fun.com/Alive/F5R Naturally, old `%masked` will have to be one-use. Similar fold exists for patterns c,d,e, will post patch later. https://bugs.llvm.org/show_bug.cgi?id=42563 Reviewers: spatel, nikic, xbolva00 Reviewed By: spatel Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67677
  6. [BreakFalseDeps] ignore function with minsize attribute This came up in the x86-specific: https://bugs.llvm.org/show_bug.cgi?id=43239 ...but it is a general problem for the BreakFalseDeps pass. Dependencies may be broken by adding some other instruction, so that should be avoided if the overall goal is to minimize size. Differential Revision: https://reviews.llvm.org/D67363
Revision 372633 by martong:
[ASTImporter] Attempt to fix Windows buildbot test errors
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/unittests/AST/ASTImporterODRStrategiesTest.cpp (diff)clang.src/unittests/AST/ASTImporterODRStrategiesTest.cpp
Revision 372632 by Louis Dionne:
[libc++] Mark CTAD tests as not failing on AppleClang 10.0.1

They do fail on AppleClang 10.0.0, but not AppleClang 10.0.1
Change TypePath in RepositoryPath in Workspace
The file was modified/libcxx/trunk/test/std/containers/associative/map/map.cons/deduct.fail.cpp (diff)libcxx.src/test/std/containers/associative/map/map.cons/deduct.fail.cpp
The file was modified/libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp (diff)libcxx.src/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp
The file was modified/libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/deduct.fail.cpp (diff)libcxx.src/test/std/containers/associative/multiset/multiset.cons/deduct.fail.cpp
The file was modified/libcxx/trunk/test/std/containers/associative/set/set.cons/deduct.fail.cpp (diff)libcxx.src/test/std/containers/associative/set/set.cons/deduct.fail.cpp
The file was modified/libcxx/trunk/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.fail.cpp (diff)libcxx.src/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.fail.cpp
The file was modified/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct.fail.cpp (diff)libcxx.src/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct.fail.cpp
The file was modified/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/deduct.fail.cpp (diff)libcxx.src/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/deduct.fail.cpp
The file was modified/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/deduct.fail.cpp (diff)libcxx.src/test/std/containers/unord/unord.set/unord.set.cnstr/deduct.fail.cpp
Revision 372631 by epilk:
NFC: Fix a poorly-written test

The author of r364954 foolishly forgot that == binds tighter than ?:
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/test/SemaCXX/constexpr-builtin-bit-cast.cpp (diff)clang.src/test/SemaCXX/constexpr-builtin-bit-cast.cpp
Revision 372630 by lebedevri:
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563)

Summary:
If we have a pattern `(x & (-1 >> maskNbits)) << shiftNbits`,
we already know (have a fold) that will drop the `& (-1 >> maskNbits)`
mask iff `(shiftNbits-maskNbits) s>= 0` (i.e. `shiftNbits u>= maskNbits`).

So even if `(shiftNbits-maskNbits) s< 0`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: c, normal+mask
  %t0 = lshr i32 -1, C1
  %t1 = and i32 %t0, %x
  %r = shl i32 %t1, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = i32 ((-(C2-C1))+32)
  %n2 = zext i32 %n1 to i64
  %n3 = lshr i64 -1, %n2
  %n4 = trunc i64 %n3 to i32
  %r = and i32 %n0, %n4
```
https://rise4fun.com/Alive/gslRa

Naturally, old `%masked` will have to be one-use.
This is not valid for pattern f - where "masking" is done via `ashr`.

https://bugs.llvm.org/show_bug.cgi?id=42563

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67725
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp (diff)llvm.src/lib/Transforms/InstCombine/InstCombineShifts.cpp
The file was modified/llvm/trunk/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-c.ll (diff)llvm.src/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-c.ll
The file was modified/llvm/trunk/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-d.ll (diff)llvm.src/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-d.ll
The file was modified/llvm/trunk/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-e.ll (diff)llvm.src/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-e.ll
Revision 372629 by lebedevri:
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563)

Summary:
And this is **finally** the interesting part of that fold!

If we have a pattern `(x & (~(-1 << maskNbits))) << shiftNbits`,
we already know (have a fold) that will drop the `& (~(-1 << maskNbits))`
mask iff `(maskNbits+shiftNbits) u>= bitwidth(x)`.
But that is actually ignorant, there's more general fold here:

In this pattern, `(maskNbits+shiftNbits)` actually correlates
with the number of low bits that will remain in the final value.
So even if `(maskNbits+shiftNbits) u< bitwidth(x)`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: a, normal+mask
  %onebit = shl i32 -1, C1
  %mask = xor i32 %onebit, -1
  %masked = and i32 %mask, %x
  %r = shl i32 %masked, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = add i32 C1, C2
  %n2 = zext i32 %n1 to i64
  %n3 = shl i64 -1, %n2
  %n4 = xor i64 %n3, -1
  %n5 = trunc i64 %n4 to i32
  %r = and i32 %n0, %n5
```
https://rise4fun.com/Alive/F5R

Naturally, old `%masked` will have to be one-use.
Similar fold exists for patterns c,d,e, will post patch later.

https://bugs.llvm.org/show_bug.cgi?id=42563

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67677
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp (diff)llvm.src/lib/Transforms/InstCombine/InstCombineShifts.cpp
The file was modified/llvm/trunk/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-a.ll (diff)llvm.src/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-a.ll
The file was modified/llvm/trunk/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-b.ll (diff)llvm.src/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-b.ll
Revision 372628 by spatel:
[BreakFalseDeps] ignore function with minsize attribute

This came up in the x86-specific:
https://bugs.llvm.org/show_bug.cgi?id=43239
...but it is a general problem for the BreakFalseDeps pass.
Dependencies may be broken by adding some other instruction,
so that should be avoided if the overall goal is to minimize size.

Differential Revision: https://reviews.llvm.org/D67363
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/CodeGen/BreakFalseDeps.cpp (diff)llvm.src/lib/CodeGen/BreakFalseDeps.cpp
The file was modified/llvm/trunk/test/CodeGen/ARM/a15-partial-update.ll (diff)llvm.src/test/CodeGen/ARM/a15-partial-update.ll
The file was modified/llvm/trunk/test/CodeGen/X86/sqrt-partial.ll (diff)llvm.src/test/CodeGen/X86/sqrt-partial.ll
The file was modified/llvm/trunk/test/CodeGen/X86/stack-folding-fp-avx1.ll (diff)llvm.src/test/CodeGen/X86/stack-folding-fp-avx1.ll
The file was modified/llvm/trunk/test/CodeGen/X86/stack-folding-fp-sse42.ll (diff)llvm.src/test/CodeGen/X86/stack-folding-fp-sse42.ll