[PATCH] D62257: [DAGCombiner][X86][AArch64] (x - C) + y -> (x + y) - C fold

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 03:46:10 PDT 2019


lebedev.ri added a comment.

In D62257#1519873 <https://reviews.llvm.org/D62257#1519873>, @lebedev.ri wrote:

> This particular patch appears to be the culprit, it's parent patches are fine.


And reduced `test-suite/MultiSource/Benchmarks/TSVC/ControlFlow-dbl/tsc.c` to

  ; ModuleID = 'bugpoint-reduced-simplified.bc'
  source_filename = "input.c"
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-unknown-linux-gnu"
  
  define dso_local <4 x i32> @b(<4 x i64> %arg) local_unnamed_addr #0 {
    %t0 = add <4 x i64> %arg, <i64 8, i64 8, i64 8, i64 8>
    %t1 = trunc <4 x i64> %t0 to <4 x i32>
    %t2 = add <4 x i32> %t1, <i32 1, i32 1, i32 1, i32 1>
    %t3 = and <4 x i32> %t2, <i32 3, i32 3, i32 3, i32 3>
    ret <4 x i32> %t3
  }
  
  attributes #0 = { "use-soft-float"="false" }
  
  !llvm.ident = !{!0}
  
  !0 = !{!"clang version 9.0.0 (trunk 362014) (llvm/trunk 362022)"}


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62257/new/

https://reviews.llvm.org/D62257





More information about the llvm-commits mailing list