diff --git a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp --- a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp +++ b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp @@ -84,9 +84,16 @@ "for faster compile. Caps the MemorySSA clobbering calls.")); static cl::opt EarlyCSEDebugHash( - "earlycse-debug-hash", cl::init(false), cl::Hidden, - cl::desc("Perform extra assertion checking to verify that SimpleValue's hash " - "function is well-behaved w.r.t. its isEqual predicate")); + "earlycse-debug-hash", +#ifdef EXPENSIVE_CHECKS + cl::init(true), +#else + cl::init(false), +#endif + cl::Hidden, + cl::desc( + "Perform extra assertion checking to verify that SimpleValue's hash " + "function is well-behaved w.r.t. its isEqual predicate")); //===----------------------------------------------------------------------===// // SimpleValue diff --git a/llvm/test/Analysis/MemorySSA/pr41853.ll b/llvm/test/Analysis/MemorySSA/pr41853.ll --- a/llvm/test/Analysis/MemorySSA/pr41853.ll +++ b/llvm/test/Analysis/MemorySSA/pr41853.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -memoryssa -loop-simplify -early-cse-memssa -verify-memoryssa %s | FileCheck %s +; RUN: opt -S -memoryssa -loop-simplify -early-cse-memssa -earlycse-debug-hash -verify-memoryssa %s | FileCheck %s ; RUN: opt -S -memoryssa -loop-simplify -early-cse-memssa -enable-mssa-loop-dependency -verify-memoryssa %s | FileCheck %s ; REQUIRES: asserts target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/test/CodeGen/PowerPC/no-dup-of-bdnz.ll b/llvm/test/CodeGen/PowerPC/no-dup-of-bdnz.ll --- a/llvm/test/CodeGen/PowerPC/no-dup-of-bdnz.ll +++ b/llvm/test/CodeGen/PowerPC/no-dup-of-bdnz.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse-memssa -loop-rotate -licm -loop-rotate -S %s -o - | FileCheck %s +; RUN: opt -early-cse-memssa -earlycse-debug-hash -loop-rotate -licm -loop-rotate -S %s -o - | FileCheck %s ; ModuleID = 'bugpoint-reduced-simplified.bc' source_filename = "bugpoint-output-8903f29.bc" target datalayout = "e-m:e-i64:64-n32:64" diff --git a/llvm/test/CodeGen/X86/mmx-bitcast-fold.ll b/llvm/test/CodeGen/X86/mmx-bitcast-fold.ll --- a/llvm/test/CodeGen/X86/mmx-bitcast-fold.ll +++ b/llvm/test/CodeGen/X86/mmx-bitcast-fold.ll @@ -1,4 +1,4 @@ -; RUN: opt -mtriple=x86_64-- -early-cse < %s -S | FileCheck %s +; RUN: opt -mtriple=x86_64-- -early-cse -earlycse-debug-hash < %s -S | FileCheck %s ; CHECK: @foo(x86_mmx bitcast (double 0.000000e+00 to x86_mmx)) diff --git a/llvm/test/DebugInfo/Generic/pr40628.ll b/llvm/test/DebugInfo/Generic/pr40628.ll --- a/llvm/test/DebugInfo/Generic/pr40628.ll +++ b/llvm/test/DebugInfo/Generic/pr40628.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S %s -o - | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S %s -o - | FileCheck %s ; PR40628: The first load below is determined to be redundant by EarlyCSE. ; During salvaging, the corresponding dbg.value could have a DW_OP_deref used diff --git a/llvm/test/DebugInfo/salvage-cast-debug-info.ll b/llvm/test/DebugInfo/salvage-cast-debug-info.ll --- a/llvm/test/DebugInfo/salvage-cast-debug-info.ll +++ b/llvm/test/DebugInfo/salvage-cast-debug-info.ll @@ -1,4 +1,4 @@ -; RUN: opt %s -debugify -early-cse -S | FileCheck %s +; RUN: opt %s -debugify -early-cse -earlycse-debug-hash -S | FileCheck %s define i32 @foo(i64 %nose, i32 %more) { ; CHECK-LABEL: @foo( ; CHECK: call void @llvm.dbg.value(metadata i64 %nose, metadata [[V1:![0-9]+]], metadata !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned diff --git a/llvm/test/Feature/OperandBundles/early-cse.ll b/llvm/test/Feature/OperandBundles/early-cse.ll --- a/llvm/test/Feature/OperandBundles/early-cse.ll +++ b/llvm/test/Feature/OperandBundles/early-cse.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s ; While it is normally okay to do memory optimizations over calls to ; @readonly_function and @readnone_function, we cannot do that if diff --git a/llvm/test/Feature/OperandBundles/special-state.ll b/llvm/test/Feature/OperandBundles/special-state.ll --- a/llvm/test/Feature/OperandBundles/special-state.ll +++ b/llvm/test/Feature/OperandBundles/special-state.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s ; This test isn't directly related to EarlyCSE or varargs. It is just ; using these as a vehicle for testing the correctness of diff --git a/llvm/test/Other/debugcounter-earlycse.ll b/llvm/test/Other/debugcounter-earlycse.ll --- a/llvm/test/Other/debugcounter-earlycse.ll +++ b/llvm/test/Other/debugcounter-earlycse.ll @@ -1,5 +1,5 @@ ; REQUIRES: asserts -; RUN: opt -S -debug-counter=early-cse-skip=1,early-cse-count=1 -early-cse < %s 2>&1 | FileCheck %s +; RUN: opt -S -debug-counter=early-cse-skip=1,early-cse-count=1 -early-cse -earlycse-debug-hash < %s 2>&1 | FileCheck %s ;; Test that, with debug counters on, we only optimize the second CSE opportunity. define i32 @test(i32 %a, i32 %b) { ; CHECK-LABEL: @test( diff --git a/llvm/test/Other/invariant.group.ll b/llvm/test/Other/invariant.group.ll --- a/llvm/test/Other/invariant.group.ll +++ b/llvm/test/Other/invariant.group.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s ; RUN: opt -S -gvn < %s | FileCheck %s ; RUN: opt -S -newgvn < %s | FileCheck %s ; RUN: opt -S -O3 < %s | FileCheck %s @@ -101,4 +101,4 @@ declare i8* @llvm.strip.invariant.group.p0i8(i8*) -!0 = !{} \ No newline at end of file +!0 = !{} diff --git a/llvm/test/Other/opt-bisect-legacy-pass-manager.ll b/llvm/test/Other/opt-bisect-legacy-pass-manager.ll --- a/llvm/test/Other/opt-bisect-legacy-pass-manager.ll +++ b/llvm/test/Other/opt-bisect-legacy-pass-manager.ll @@ -83,14 +83,14 @@ ; Test a function pass. -; RUN: opt -disable-output -disable-verify -early-cse -opt-bisect-limit=-1 \ +; RUN: opt -disable-output -disable-verify -early-cse -earlycse-debug-hash -opt-bisect-limit=-1 \ ; RUN: %s 2>&1 | FileCheck %s --check-prefix=CHECK-EARLY-CSE ; CHECK-EARLY-CSE: BISECT: running pass ({{[0-9]+}}) Early CSE on function (f1) ; CHECK-EARLY-CSE: BISECT: running pass ({{[0-9]+}}) Early CSE on function (f2) ; CHECK-EARLY-CSE: BISECT: running pass ({{[0-9]+}}) Early CSE on function (f3) -; RUN: opt -disable-output -disable-verify -early-cse -opt-bisect-limit=0 %s \ -; RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-NOT-EARLY-CSE +; RUN: opt -disable-output -disable-verify -early-cse -earlycse-debug-hash -opt-bisect-limit=0 \ +; RUN: %s 2>&1 | FileCheck %s --check-prefix=CHECK-NOT-EARLY-CSE ; CHECK-NOT-EARLY-CSE: BISECT: NOT running pass ({{[0-9]+}}) Early CSE on function (f1) ; CHECK-NOT-EARLY-CSE: BISECT: NOT running pass ({{[0-9]+}}) Early CSE on function (f2) ; CHECK-NOT-EARLY-CSE: BISECT: NOT running pass ({{[0-9]+}}) Early CSE on function (f3) diff --git a/llvm/test/Other/print-debug-counter.ll b/llvm/test/Other/print-debug-counter.ll --- a/llvm/test/Other/print-debug-counter.ll +++ b/llvm/test/Other/print-debug-counter.ll @@ -1,6 +1,6 @@ ; REQUIRES: asserts -; RUN: opt -S -debug-counter=early-cse-skip=1,early-cse-count=1 -early-cse \ +; RUN: opt -S -debug-counter=early-cse-skip=1,early-cse-count=1 -early-cse -earlycse-debug-hash \ ; RUN: -debug-counter=newgvn-vn-skip=1,newgvn-vn-count=2 -newgvn \ ; RUN: -instcombine -print-debug-counter < %s 2>&1 | FileCheck %s ;; Test debug counter prints correct info in right order. diff --git a/llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll b/llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll --- a/llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll +++ b/llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -S -mtriple=aarch64-none-linux-gnu -mattr=+neon -early-cse | FileCheck %s +; RUN: opt < %s -S -mtriple=aarch64-none-linux-gnu -mattr=+neon -early-cse -earlycse-debug-hash | FileCheck %s ; RUN: opt < %s -S -mtriple=aarch64-none-linux-gnu -mattr=+neon -basic-aa -early-cse-memssa | FileCheck %s ; RUN: opt < %s -S -mtriple=aarch64-none-linux-gnu -mattr=+neon -passes=early-cse | FileCheck %s ; RUN: opt < %s -S -mtriple=aarch64-none-linux-gnu -mattr=+neon -aa-pipeline=basic-aa -passes=early-cse-memssa | FileCheck %s diff --git a/llvm/test/Transforms/EarlyCSE/AArch64/ldstN.ll b/llvm/test/Transforms/EarlyCSE/AArch64/ldstN.ll --- a/llvm/test/Transforms/EarlyCSE/AArch64/ldstN.ll +++ b/llvm/test/Transforms/EarlyCSE/AArch64/ldstN.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s ; RUN: opt -S -basic-aa -early-cse-memssa < %s | FileCheck %s target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128" target triple = "aarch64--linux-gnu" diff --git a/llvm/test/Transforms/EarlyCSE/AMDGPU/intrinsics.ll b/llvm/test/Transforms/EarlyCSE/AMDGPU/intrinsics.ll --- a/llvm/test/Transforms/EarlyCSE/AMDGPU/intrinsics.ll +++ b/llvm/test/Transforms/EarlyCSE/AMDGPU/intrinsics.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -S -mtriple=amdgcn-- -early-cse | FileCheck %s +; RUN: opt < %s -S -mtriple=amdgcn-- -early-cse -earlycse-debug-hash | FileCheck %s ; CHECK-LABEL: @no_cse ; CHECK: call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> %in, i32 0, i32 0) diff --git a/llvm/test/Transforms/EarlyCSE/AMDGPU/memrealtime.ll b/llvm/test/Transforms/EarlyCSE/AMDGPU/memrealtime.ll --- a/llvm/test/Transforms/EarlyCSE/AMDGPU/memrealtime.ll +++ b/llvm/test/Transforms/EarlyCSE/AMDGPU/memrealtime.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -early-cse-memssa < %s | FileCheck %s +; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -early-cse-memssa -earlycse-debug-hash < %s | FileCheck %s target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5" ; CHECK-LABEL: @memrealtime( diff --git a/llvm/test/Transforms/EarlyCSE/PowerPC/read-reg.ll b/llvm/test/Transforms/EarlyCSE/PowerPC/read-reg.ll --- a/llvm/test/Transforms/EarlyCSE/PowerPC/read-reg.ll +++ b/llvm/test/Transforms/EarlyCSE/PowerPC/read-reg.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s ; RUN: opt -S -basic-aa -early-cse-memssa < %s | FileCheck %s target datalayout = "E-m:e-i64:64-n32:64" target triple = "powerpc64-unknown-linux-gnu" diff --git a/llvm/test/Transforms/EarlyCSE/X86/preserve_memoryssa.ll b/llvm/test/Transforms/EarlyCSE/X86/preserve_memoryssa.ll --- a/llvm/test/Transforms/EarlyCSE/X86/preserve_memoryssa.ll +++ b/llvm/test/Transforms/EarlyCSE/X86/preserve_memoryssa.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -early-cse-memssa -verify-memoryssa -disable-output +; RUN: opt < %s -early-cse-memssa -earlycse-debug-hash -verify-memoryssa -disable-output ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" diff --git a/llvm/test/Transforms/EarlyCSE/and_or.ll b/llvm/test/Transforms/EarlyCSE/and_or.ll --- a/llvm/test/Transforms/EarlyCSE/and_or.ll +++ b/llvm/test/Transforms/EarlyCSE/and_or.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -early-cse -S < %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s ; RUN: opt -basic-aa -early-cse-memssa -S < %s | FileCheck %s define i32 @test_01(i32 %a, i32 %b) { diff --git a/llvm/test/Transforms/EarlyCSE/atomics.ll b/llvm/test/Transforms/EarlyCSE/atomics.ll --- a/llvm/test/Transforms/EarlyCSE/atomics.ll +++ b/llvm/test/Transforms/EarlyCSE/atomics.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -S -early-cse | FileCheck %s +; RUN: opt < %s -S -early-cse -earlycse-debug-hash | FileCheck %s ; RUN: opt < %s -S -basic-aa -early-cse-memssa | FileCheck %s ; CHECK-LABEL: @test12( diff --git a/llvm/test/Transforms/EarlyCSE/basic.ll b/llvm/test/Transforms/EarlyCSE/basic.ll --- a/llvm/test/Transforms/EarlyCSE/basic.ll +++ b/llvm/test/Transforms/EarlyCSE/basic.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -S -early-cse | FileCheck %s +; RUN: opt < %s -S -early-cse -earlycse-debug-hash | FileCheck %s ; RUN: opt < %s -S -basic-aa -early-cse-memssa | FileCheck %s ; RUN: opt < %s -S -passes=early-cse | FileCheck %s diff --git a/llvm/test/Transforms/EarlyCSE/conditional.ll b/llvm/test/Transforms/EarlyCSE/conditional.ll --- a/llvm/test/Transforms/EarlyCSE/conditional.ll +++ b/llvm/test/Transforms/EarlyCSE/conditional.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S < %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s ; RUN: opt -basic-aa -early-cse-memssa -S < %s | FileCheck %s ; Can we CSE a known condition to a constant? diff --git a/llvm/test/Transforms/EarlyCSE/const-speculation.ll b/llvm/test/Transforms/EarlyCSE/const-speculation.ll --- a/llvm/test/Transforms/EarlyCSE/const-speculation.ll +++ b/llvm/test/Transforms/EarlyCSE/const-speculation.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S %s | FileCheck %s %mystruct = type { i32 } diff --git a/llvm/test/Transforms/EarlyCSE/debug-info-undef.ll b/llvm/test/Transforms/EarlyCSE/debug-info-undef.ll --- a/llvm/test/Transforms/EarlyCSE/debug-info-undef.ll +++ b/llvm/test/Transforms/EarlyCSE/debug-info-undef.ll @@ -1,4 +1,4 @@ -; RUN: opt -S %s -early-cse | FileCheck %s +; RUN: opt -S %s -early-cse -earlycse-debug-hash | FileCheck %s target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" diff --git a/llvm/test/Transforms/EarlyCSE/debuginfo-dce.ll b/llvm/test/Transforms/EarlyCSE/debuginfo-dce.ll --- a/llvm/test/Transforms/EarlyCSE/debuginfo-dce.ll +++ b/llvm/test/Transforms/EarlyCSE/debuginfo-dce.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S %s -o - | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S %s -o - | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; Function Attrs: nounwind uwtable diff --git a/llvm/test/Transforms/EarlyCSE/edge.ll b/llvm/test/Transforms/EarlyCSE/edge.ll --- a/llvm/test/Transforms/EarlyCSE/edge.ll +++ b/llvm/test/Transforms/EarlyCSE/edge.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S < %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s ; RUN: opt -basic-aa -early-cse-memssa -S < %s | FileCheck %s ; Same as GVN/edge.ll, but updated to reflect EarlyCSE's less powerful ; implementation. EarlyCSE currently doesn't exploit equality comparisons diff --git a/llvm/test/Transforms/EarlyCSE/fence.ll b/llvm/test/Transforms/EarlyCSE/fence.ll --- a/llvm/test/Transforms/EarlyCSE/fence.ll +++ b/llvm/test/Transforms/EarlyCSE/fence.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s ; RUN: opt < %s -S -basic-aa -early-cse-memssa | FileCheck %s ; NOTE: This file is testing the current implementation. Some of ; the transforms used as negative tests below would be legal, but diff --git a/llvm/test/Transforms/EarlyCSE/flags.ll b/llvm/test/Transforms/EarlyCSE/flags.ll --- a/llvm/test/Transforms/EarlyCSE/flags.ll +++ b/llvm/test/Transforms/EarlyCSE/flags.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S < %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s ; RUN: opt -basic-aa -early-cse-memssa -S < %s | FileCheck %s declare void @use(i1) diff --git a/llvm/test/Transforms/EarlyCSE/floatingpoint.ll b/llvm/test/Transforms/EarlyCSE/floatingpoint.ll --- a/llvm/test/Transforms/EarlyCSE/floatingpoint.ll +++ b/llvm/test/Transforms/EarlyCSE/floatingpoint.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -S -early-cse | FileCheck %s +; RUN: opt < %s -S -early-cse -earlycse-debug-hash | FileCheck %s ; RUN: opt < %s -S -basic-aa -early-cse-memssa | FileCheck %s ; Ensure we don't simplify away additions vectors of +0.0's (same as scalars). diff --git a/llvm/test/Transforms/EarlyCSE/gc_relocate.ll b/llvm/test/Transforms/EarlyCSE/gc_relocate.ll --- a/llvm/test/Transforms/EarlyCSE/gc_relocate.ll +++ b/llvm/test/Transforms/EarlyCSE/gc_relocate.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -early-cse -S < %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s declare void @func() declare i32 @"personality_function"() diff --git a/llvm/test/Transforms/EarlyCSE/globalsaa-memoryssa.ll b/llvm/test/Transforms/EarlyCSE/globalsaa-memoryssa.ll --- a/llvm/test/Transforms/EarlyCSE/globalsaa-memoryssa.ll +++ b/llvm/test/Transforms/EarlyCSE/globalsaa-memoryssa.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt < %s -S -globals-aa -early-cse-memssa | FileCheck %s +; RUN: opt < %s -S -globals-aa -early-cse-memssa -earlycse-debug-hash | FileCheck %s define i16 @f1() readonly { ret i16 0 diff --git a/llvm/test/Transforms/EarlyCSE/guards.ll b/llvm/test/Transforms/EarlyCSE/guards.ll --- a/llvm/test/Transforms/EarlyCSE/guards.ll +++ b/llvm/test/Transforms/EarlyCSE/guards.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -early-cse < %s | FileCheck %s --check-prefixes=CHECK,NO_ASSUME +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s --check-prefixes=CHECK,NO_ASSUME ; RUN: opt < %s -S -basic-aa -early-cse-memssa | FileCheck %s --check-prefixes=CHECK,NO_ASSUME ; RUN: opt < %s -S -basic-aa -early-cse-memssa --enable-knowledge-retention | FileCheck %s --check-prefixes=CHECK,USE_ASSUME diff --git a/llvm/test/Transforms/EarlyCSE/instsimplify-dom.ll b/llvm/test/Transforms/EarlyCSE/instsimplify-dom.ll --- a/llvm/test/Transforms/EarlyCSE/instsimplify-dom.ll +++ b/llvm/test/Transforms/EarlyCSE/instsimplify-dom.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S < %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s ; RUN: opt -basic-aa -early-cse-memssa -S < %s | FileCheck %s ; PR12231 diff --git a/llvm/test/Transforms/EarlyCSE/int_sideeffect.ll b/llvm/test/Transforms/EarlyCSE/int_sideeffect.ll --- a/llvm/test/Transforms/EarlyCSE/int_sideeffect.ll +++ b/llvm/test/Transforms/EarlyCSE/int_sideeffect.ll @@ -1,4 +1,4 @@ -; RUN: opt -S < %s -early-cse | FileCheck %s +; RUN: opt -S < %s -early-cse -earlycse-debug-hash | FileCheck %s declare void @llvm.sideeffect() diff --git a/llvm/test/Transforms/EarlyCSE/invariant-loads.ll b/llvm/test/Transforms/EarlyCSE/invariant-loads.ll --- a/llvm/test/Transforms/EarlyCSE/invariant-loads.ll +++ b/llvm/test/Transforms/EarlyCSE/invariant-loads.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -early-cse < %s | FileCheck %s --check-prefixes=CHECK,NO_ASSUME +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s --check-prefixes=CHECK,NO_ASSUME ; RUN: opt -S -basic-aa -early-cse-memssa < %s | FileCheck %s --check-prefixes=CHECK,NO_ASSUME ; RUN: opt -S -basic-aa -early-cse-memssa --enable-knowledge-retention < %s | FileCheck %s --check-prefixes=CHECK,USE_ASSUME diff --git a/llvm/test/Transforms/EarlyCSE/invariant.start.ll b/llvm/test/Transforms/EarlyCSE/invariant.start.ll --- a/llvm/test/Transforms/EarlyCSE/invariant.start.ll +++ b/llvm/test/Transforms/EarlyCSE/invariant.start.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature -; RUN: opt < %s -S -early-cse | FileCheck %s --check-prefixes=CHECK,NO_ASSUME +; RUN: opt < %s -S -early-cse -earlycse-debug-hash | FileCheck %s --check-prefixes=CHECK,NO_ASSUME ; RUN: opt < %s -S -early-cse --enable-knowledge-retention | FileCheck %s --check-prefixes=CHECK,USE_ASSUME ; RUN: opt < %s -S -passes=early-cse | FileCheck %s --check-prefixes=CHECK,NO_ASSUME diff --git a/llvm/test/Transforms/EarlyCSE/memoryssa.ll b/llvm/test/Transforms/EarlyCSE/memoryssa.ll --- a/llvm/test/Transforms/EarlyCSE/memoryssa.ll +++ b/llvm/test/Transforms/EarlyCSE/memoryssa.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -S -early-cse | FileCheck %s --check-prefix=CHECK-NOMEMSSA +; RUN: opt < %s -S -early-cse -earlycse-debug-hash | FileCheck %s --check-prefix=CHECK-NOMEMSSA ; RUN: opt < %s -S -basic-aa -early-cse-memssa | FileCheck %s ; RUN: opt < %s -S -passes='early-cse' | FileCheck %s --check-prefix=CHECK-NOMEMSSA ; RUN: opt < %s -S -aa-pipeline=basic-aa -passes='early-cse-memssa' | FileCheck %s diff --git a/llvm/test/Transforms/EarlyCSE/phi.ll b/llvm/test/Transforms/EarlyCSE/phi.ll --- a/llvm/test/Transforms/EarlyCSE/phi.ll +++ b/llvm/test/Transforms/EarlyCSE/phi.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -early-cse -S < %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s ; RUN: opt -basic-aa -early-cse-memssa -S < %s | FileCheck %s ; Most basic case, fully identical PHI nodes diff --git a/llvm/test/Transforms/EarlyCSE/pr33406.ll b/llvm/test/Transforms/EarlyCSE/pr33406.ll --- a/llvm/test/Transforms/EarlyCSE/pr33406.ll +++ b/llvm/test/Transforms/EarlyCSE/pr33406.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse-memssa -S %s | FileCheck %s +; RUN: opt -early-cse-memssa -earlycse-debug-hash -S %s | FileCheck %s ; CHECK: define void @patatino() { ; CHECK: for.cond: diff --git a/llvm/test/Transforms/EarlyCSE/readnone-mayunwind.ll b/llvm/test/Transforms/EarlyCSE/readnone-mayunwind.ll --- a/llvm/test/Transforms/EarlyCSE/readnone-mayunwind.ll +++ b/llvm/test/Transforms/EarlyCSE/readnone-mayunwind.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s declare void @readnone_may_unwind() readnone diff --git a/llvm/test/Transforms/EarlyCSE/writeonly.ll b/llvm/test/Transforms/EarlyCSE/writeonly.ll --- a/llvm/test/Transforms/EarlyCSE/writeonly.ll +++ b/llvm/test/Transforms/EarlyCSE/writeonly.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s @var = global i32 undef declare void @foo() nounwind diff --git a/llvm/test/Transforms/GVNHoist/pr37445.ll b/llvm/test/Transforms/GVNHoist/pr37445.ll --- a/llvm/test/Transforms/GVNHoist/pr37445.ll +++ b/llvm/test/Transforms/GVNHoist/pr37445.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -early-cse-memssa -gvn-hoist -S | FileCheck %s +; RUN: opt < %s -early-cse-memssa -earlycse-debug-hash -gvn-hoist -S | FileCheck %s ; Make sure opt won't crash and that this pair of ; instructions (load, icmp) is hoisted successfully diff --git a/llvm/test/Transforms/GVNHoist/pr38807.ll b/llvm/test/Transforms/GVNHoist/pr38807.ll --- a/llvm/test/Transforms/GVNHoist/pr38807.ll +++ b/llvm/test/Transforms/GVNHoist/pr38807.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -early-cse-memssa -gvn-hoist -S | FileCheck %s +; RUN: opt < %s -early-cse-memssa -earlycse-debug-hash -gvn-hoist -S | FileCheck %s ; Make sure opt doesn't crash. On top of that, the instructions ; of the side blocks should be hoisted to the entry block. diff --git a/llvm/test/Transforms/Inline/inline-indirect-chain.ll b/llvm/test/Transforms/Inline/inline-indirect-chain.ll --- a/llvm/test/Transforms/Inline/inline-indirect-chain.ll +++ b/llvm/test/Transforms/Inline/inline-indirect-chain.ll @@ -1,4 +1,4 @@ -; RUN: opt -inline -early-cse < %s +; RUN: opt -inline -early-cse -earlycse-debug-hash < %s ; This test used to crash (PR35469). define void @func1() { diff --git a/llvm/test/Transforms/InstCombine/invariant.group.ll b/llvm/test/Transforms/InstCombine/invariant.group.ll --- a/llvm/test/Transforms/InstCombine/invariant.group.ll +++ b/llvm/test/Transforms/InstCombine/invariant.group.ll @@ -1,4 +1,4 @@ -; RUN: opt -instcombine -early-cse -S < %s | FileCheck %s +; RUN: opt -instcombine -early-cse -earlycse-debug-hash -S < %s | FileCheck %s ; CHECK-LABEL: define i8* @simplifyNullLaunder() diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/allones.ll b/llvm/test/Transforms/InstSimplify/ConstProp/allones.ll --- a/llvm/test/Transforms/InstSimplify/ConstProp/allones.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/allones.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S -o - %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S -o - %s | FileCheck %s target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64-ni:2" target triple = "armv7-unknown-linux-gnueabi" diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/math-1.ll b/llvm/test/Transforms/InstSimplify/ConstProp/math-1.ll --- a/llvm/test/Transforms/InstSimplify/ConstProp/math-1.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/math-1.ll @@ -1,195 +1,195 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -early-cse -S -o - %s | FileCheck %s - -declare double @acos(double) -define double @f_acos() { -; CHECK-LABEL: @f_acos( -; CHECK-NEXT: ret double 0.000000e+00 -; - %res = tail call fast double @acos(double 1.0) - ret double %res -} - -declare float @asinf(float) -define float @f_asinf() { -; CHECK-LABEL: @f_asinf( -; CHECK-NEXT: ret float 0x3FF921FB{{.+}} -; - %res = tail call fast float @asinf(float 1.0) - ret float %res -} - -declare double @atan(double) -define double @f_atan() { -; CHECK-LABEL: @f_atan( -; CHECK-NEXT: [[RES:%.*]] = tail call fast double @atan(double 1.000000e+00) -; CHECK-NEXT: ret double 0x3FE921FB -; - %res = tail call fast double @atan(double 1.0) - ret double %res -} - -declare float @cosf(float) -define float @f_cosf() { -; CHECK-LABEL: @f_cosf( -; CHECK-NEXT: ret float 0x3FE14A2{{.+}} -; - %res = tail call fast float @cosf(float 1.0) - ret float %res -} - -declare float @llvm.cos.f32(float) -define float @i_cosf() { -; CHECK-LABEL: @i_cosf( -; CHECK-NEXT: ret float 0x3FE14A2 -; - %res = tail call fast float @llvm.cos.f32(float 1.0) - ret float %res -} - -declare double @cosh(double) -define double @f_cosh() { -; CHECK-LABEL: @f_cosh( -; CHECK-NEXT: ret double 0x3FF8B075{{.+}} -; - %res = tail call fast double @cosh(double 1.0) - ret double %res -} - -declare float @expf(float) -define float @f_expf() { -; CHECK-LABEL: @f_expf( -; CHECK-NEXT: ret float 0x4005BF0A{{.+}} -; - %res = tail call fast float @expf(float 1.0) - ret float %res -} - -declare float @llvm.exp.f32(float) -define float @i_expf() { -; CHECK-LABEL: @i_expf( -; CHECK-NEXT: ret float 0x4005BF0A{{.+}} -; - %res = tail call fast float @llvm.exp.f32(float 1.0) - ret float %res -} - -declare double @exp2(double) -define double @f_exp2() { -; CHECK-LABEL: @f_exp2( -; CHECK-NEXT: ret double 2.000000e+00 -; - %res = tail call fast double @exp2(double 1.0) - ret double %res -} - -declare double @llvm.exp2.f64(double) -define double @i_exp2() { -; CHECK-LABEL: @i_exp2( -; CHECK-NEXT: ret double 2.000000e+00 -; - %res = tail call fast double @llvm.exp2.f64(double 1.0) - ret double %res -} - -; FIXME: exp10() is not widely supported. -declare float @exp10f(float) -define float @f_exp10f() { -; CHECK-LABEL: @f_exp10f( -; CHECK-NEXT: [[RES:%.*]] = tail call float @exp10f(float 1.000000e+00) -; CHECK-NEXT: ret float [[RES]] -; - %res = tail call float @exp10f(float 1.0) - ret float %res -} - -declare double @log(double) -define double @f_log() { -; CHECK-LABEL: @f_log( -; CHECK-NEXT: ret double 0.000000e+00 -; - %res = tail call fast double @log(double 1.0) - ret double %res -} - -declare double @llvm.log.f64(double) -define double @i_log() { -; CHECK-LABEL: @i_log( -; CHECK-NEXT: ret double 0.000000e+00 -; - %res = tail call fast double @llvm.log.f64(double 1.0) - ret double %res -} - -declare float @log2f(float) -define float @f_log2f() { -; CHECK-LABEL: @f_log2f( -; CHECK-NEXT: ret float 0.000000e+00 -; - %res = tail call fast float @log2f(float 1.0) - ret float %res -} - -declare float @llvm.log2.f32(float) -define float @i_log2f() { -; CHECK-LABEL: @i_log2f( -; CHECK-NEXT: ret float 0.000000e+00 -; - %res = tail call fast float @llvm.log2.f32(float 1.0) - ret float %res -} - -declare double @log10(double) -define double @f_log10() { -; CHECK-LABEL: @f_log10( -; CHECK-NEXT: ret double 0.000000e+00 -; - %res = tail call fast double @log10(double 1.0) - ret double %res -} - -declare float @sinf(float) -define float @f_sinf() { -; CHECK-LABEL: @f_sinf( -; CHECK-NEXT: ret float 0x3FEAED54{{.+}} -; - %res = tail call fast float @sinf(float 1.0) - ret float %res -} - -declare double @sinh(double) -define double @f_sinh() { -; CHECK-LABEL: @f_sinh( -; CHECK-NEXT: ret double 0x3FF2CD9F{{.+}} -; - %res = tail call fast double @sinh(double 1.0) - ret double %res -} - -declare float @sqrtf(float) -define float @f_sqrtf() { -; CHECK-LABEL: @f_sqrtf( -; CHECK-NEXT: ret float 1.000000e+00 -; - %res = tail call fast float @sqrtf(float 1.0) - ret float %res -} - -declare double @tan(double) -define double @f_tan() { -; CHECK-LABEL: @f_tan( -; CHECK-NEXT: ret double 0x3FF8EB24{{.+}} -; - %res = tail call fast double @tan(double 1.0) - ret double %res -} - -declare float @tanhf(float) -define float @f_tanhf() { -; CHECK-LABEL: @f_tanhf( -; CHECK-NEXT: [[RES:%.*]] = tail call fast float @tanhf(float 1.000000e+00) -; CHECK-NEXT: ret float 0x3FE85EFA{{.+}} -; - %res = tail call fast float @tanhf(float 1.0) - ret float %res -} +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt -early-cse -earlycse-debug-hash -S -o - %s | FileCheck %s + +declare double @acos(double) +define double @f_acos() { +; CHECK-LABEL: @f_acos( +; CHECK-NEXT: ret double 0.000000e+00 +; + %res = tail call fast double @acos(double 1.0) + ret double %res +} + +declare float @asinf(float) +define float @f_asinf() { +; CHECK-LABEL: @f_asinf( +; CHECK-NEXT: ret float 0x3FF921FB{{.+}} +; + %res = tail call fast float @asinf(float 1.0) + ret float %res +} + +declare double @atan(double) +define double @f_atan() { +; CHECK-LABEL: @f_atan( +; CHECK-NEXT: [[RES:%.*]] = tail call fast double @atan(double 1.000000e+00) +; CHECK-NEXT: ret double 0x3FE921FB +; + %res = tail call fast double @atan(double 1.0) + ret double %res +} + +declare float @cosf(float) +define float @f_cosf() { +; CHECK-LABEL: @f_cosf( +; CHECK-NEXT: ret float 0x3FE14A2{{.+}} +; + %res = tail call fast float @cosf(float 1.0) + ret float %res +} + +declare float @llvm.cos.f32(float) +define float @i_cosf() { +; CHECK-LABEL: @i_cosf( +; CHECK-NEXT: ret float 0x3FE14A2 +; + %res = tail call fast float @llvm.cos.f32(float 1.0) + ret float %res +} + +declare double @cosh(double) +define double @f_cosh() { +; CHECK-LABEL: @f_cosh( +; CHECK-NEXT: ret double 0x3FF8B075{{.+}} +; + %res = tail call fast double @cosh(double 1.0) + ret double %res +} + +declare float @expf(float) +define float @f_expf() { +; CHECK-LABEL: @f_expf( +; CHECK-NEXT: ret float 0x4005BF0A{{.+}} +; + %res = tail call fast float @expf(float 1.0) + ret float %res +} + +declare float @llvm.exp.f32(float) +define float @i_expf() { +; CHECK-LABEL: @i_expf( +; CHECK-NEXT: ret float 0x4005BF0A{{.+}} +; + %res = tail call fast float @llvm.exp.f32(float 1.0) + ret float %res +} + +declare double @exp2(double) +define double @f_exp2() { +; CHECK-LABEL: @f_exp2( +; CHECK-NEXT: ret double 2.000000e+00 +; + %res = tail call fast double @exp2(double 1.0) + ret double %res +} + +declare double @llvm.exp2.f64(double) +define double @i_exp2() { +; CHECK-LABEL: @i_exp2( +; CHECK-NEXT: ret double 2.000000e+00 +; + %res = tail call fast double @llvm.exp2.f64(double 1.0) + ret double %res +} + +; FIXME: exp10() is not widely supported. +declare float @exp10f(float) +define float @f_exp10f() { +; CHECK-LABEL: @f_exp10f( +; CHECK-NEXT: [[RES:%.*]] = tail call float @exp10f(float 1.000000e+00) +; CHECK-NEXT: ret float [[RES]] +; + %res = tail call float @exp10f(float 1.0) + ret float %res +} + +declare double @log(double) +define double @f_log() { +; CHECK-LABEL: @f_log( +; CHECK-NEXT: ret double 0.000000e+00 +; + %res = tail call fast double @log(double 1.0) + ret double %res +} + +declare double @llvm.log.f64(double) +define double @i_log() { +; CHECK-LABEL: @i_log( +; CHECK-NEXT: ret double 0.000000e+00 +; + %res = tail call fast double @llvm.log.f64(double 1.0) + ret double %res +} + +declare float @log2f(float) +define float @f_log2f() { +; CHECK-LABEL: @f_log2f( +; CHECK-NEXT: ret float 0.000000e+00 +; + %res = tail call fast float @log2f(float 1.0) + ret float %res +} + +declare float @llvm.log2.f32(float) +define float @i_log2f() { +; CHECK-LABEL: @i_log2f( +; CHECK-NEXT: ret float 0.000000e+00 +; + %res = tail call fast float @llvm.log2.f32(float 1.0) + ret float %res +} + +declare double @log10(double) +define double @f_log10() { +; CHECK-LABEL: @f_log10( +; CHECK-NEXT: ret double 0.000000e+00 +; + %res = tail call fast double @log10(double 1.0) + ret double %res +} + +declare float @sinf(float) +define float @f_sinf() { +; CHECK-LABEL: @f_sinf( +; CHECK-NEXT: ret float 0x3FEAED54{{.+}} +; + %res = tail call fast float @sinf(float 1.0) + ret float %res +} + +declare double @sinh(double) +define double @f_sinh() { +; CHECK-LABEL: @f_sinh( +; CHECK-NEXT: ret double 0x3FF2CD9F{{.+}} +; + %res = tail call fast double @sinh(double 1.0) + ret double %res +} + +declare float @sqrtf(float) +define float @f_sqrtf() { +; CHECK-LABEL: @f_sqrtf( +; CHECK-NEXT: ret float 1.000000e+00 +; + %res = tail call fast float @sqrtf(float 1.0) + ret float %res +} + +declare double @tan(double) +define double @f_tan() { +; CHECK-LABEL: @f_tan( +; CHECK-NEXT: ret double 0x3FF8EB24{{.+}} +; + %res = tail call fast double @tan(double 1.0) + ret double %res +} + +declare float @tanhf(float) +define float @f_tanhf() { +; CHECK-LABEL: @f_tanhf( +; CHECK-NEXT: [[RES:%.*]] = tail call fast float @tanhf(float 1.000000e+00) +; CHECK-NEXT: ret float 0x3FE85EFA{{.+}} +; + %res = tail call fast float @tanhf(float 1.0) + ret float %res +} diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/math-2.ll b/llvm/test/Transforms/InstSimplify/ConstProp/math-2.ll --- a/llvm/test/Transforms/InstSimplify/ConstProp/math-2.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/math-2.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -early-cse -S -o - %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S -o - %s | FileCheck %s declare double @atan2(double, double) define double @f_atan2() { diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/rint.ll b/llvm/test/Transforms/InstSimplify/ConstProp/rint.ll --- a/llvm/test/Transforms/InstSimplify/ConstProp/rint.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/rint.ll @@ -1,109 +1,109 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -early-cse < %s | FileCheck %s - -declare float @nearbyintf(float) #0 -declare float @llvm.nearbyint.f32(float) #0 -declare double @nearbyint(double) #0 -declare double @llvm.nearbyint.f64(double) #0 -declare float @rintf(float) #0 -declare float @llvm.rint.f32(float) #0 -declare double @rint(double) #0 -declare double @llvm.rint.f64(double) #0 - -define float @constant_fold_rint_f32_01() #0 { -; CHECK-LABEL: @constant_fold_rint_f32_01( -; CHECK-NEXT: ret float 1.000000e+00 -; - %x = call float @nearbyintf(float 1.25) #0 - ret float %x -} - -define float @constant_fold_rint_f32_02() #0 { -; CHECK-LABEL: @constant_fold_rint_f32_02( -; CHECK-NEXT: ret float -1.000000e+00 -; - %x = call float @llvm.nearbyint.f32(float -1.25) #0 - ret float %x -} - -define float @constant_fold_rint_f32_03() #0 { -; CHECK-LABEL: @constant_fold_rint_f32_03( -; CHECK-NEXT: ret float 2.000000e+00 -; - %x = call float @rintf(float 1.5) #0 - ret float %x -} - -define float @constant_fold_rint_f32_04() #0 { -; CHECK-LABEL: @constant_fold_rint_f32_04( -; CHECK-NEXT: ret float -2.000000e+00 -; - %x = call float @llvm.rint.f32(float -1.5) #0 - ret float %x -} - -define float @constant_fold_rint_f32_05() #0 { -; CHECK-LABEL: @constant_fold_rint_f32_05( -; CHECK-NEXT: ret float 3.000000e+00 -; - %x = call float @nearbyintf(float 2.75) #0 - ret float %x -} - -define float @constant_fold_rint_f32_06() #0 { -; CHECK-LABEL: @constant_fold_rint_f32_06( -; CHECK-NEXT: ret float -3.000000e+00 -; - %x = call float @llvm.nearbyint.f32(float -2.75) #0 - ret float %x -} - -define double @constant_fold_rint_f64_01() #0 { -; CHECK-LABEL: @constant_fold_rint_f64_01( -; CHECK-NEXT: ret double 1.000000e+00 -; - %x = call double @rint(double 1.3) #0 - ret double %x -} - -define double @constant_fold_rint_f64_02() #0 { -; CHECK-LABEL: @constant_fold_rint_f64_02( -; CHECK-NEXT: ret double -1.000000e+00 -; - %x = call double @llvm.rint.f64(double -1.3) #0 - ret double %x -} - -define double @constant_fold_rint_f64_03() #0 { -; CHECK-LABEL: @constant_fold_rint_f64_03( -; CHECK-NEXT: ret double 2.000000e+00 -; - %x = call double @nearbyint(double 1.5) #0 - ret double %x -} - -define double @constant_fold_rint_f64_04() #0 { -; CHECK-LABEL: @constant_fold_rint_f64_04( -; CHECK-NEXT: ret double -2.000000e+00 -; - %x = call double @llvm.nearbyint.f64(double -1.5) #0 - ret double %x -} - -define double @constant_fold_rint_f64_05() #0 { -; CHECK-LABEL: @constant_fold_rint_f64_05( -; CHECK-NEXT: ret double 3.000000e+00 -; - %x = call double @rint(double 2.7) #0 - ret double %x -} - -define double @constant_fold_rint_f64_06() #0 { -; CHECK-LABEL: @constant_fold_rint_f64_06( -; CHECK-NEXT: ret double -3.000000e+00 -; - %x = call double @llvm.rint.f64(double -2.7) #0 - ret double %x -} - -attributes #0 = { nounwind readnone } +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s + +declare float @nearbyintf(float) #0 +declare float @llvm.nearbyint.f32(float) #0 +declare double @nearbyint(double) #0 +declare double @llvm.nearbyint.f64(double) #0 +declare float @rintf(float) #0 +declare float @llvm.rint.f32(float) #0 +declare double @rint(double) #0 +declare double @llvm.rint.f64(double) #0 + +define float @constant_fold_rint_f32_01() #0 { +; CHECK-LABEL: @constant_fold_rint_f32_01( +; CHECK-NEXT: ret float 1.000000e+00 +; + %x = call float @nearbyintf(float 1.25) #0 + ret float %x +} + +define float @constant_fold_rint_f32_02() #0 { +; CHECK-LABEL: @constant_fold_rint_f32_02( +; CHECK-NEXT: ret float -1.000000e+00 +; + %x = call float @llvm.nearbyint.f32(float -1.25) #0 + ret float %x +} + +define float @constant_fold_rint_f32_03() #0 { +; CHECK-LABEL: @constant_fold_rint_f32_03( +; CHECK-NEXT: ret float 2.000000e+00 +; + %x = call float @rintf(float 1.5) #0 + ret float %x +} + +define float @constant_fold_rint_f32_04() #0 { +; CHECK-LABEL: @constant_fold_rint_f32_04( +; CHECK-NEXT: ret float -2.000000e+00 +; + %x = call float @llvm.rint.f32(float -1.5) #0 + ret float %x +} + +define float @constant_fold_rint_f32_05() #0 { +; CHECK-LABEL: @constant_fold_rint_f32_05( +; CHECK-NEXT: ret float 3.000000e+00 +; + %x = call float @nearbyintf(float 2.75) #0 + ret float %x +} + +define float @constant_fold_rint_f32_06() #0 { +; CHECK-LABEL: @constant_fold_rint_f32_06( +; CHECK-NEXT: ret float -3.000000e+00 +; + %x = call float @llvm.nearbyint.f32(float -2.75) #0 + ret float %x +} + +define double @constant_fold_rint_f64_01() #0 { +; CHECK-LABEL: @constant_fold_rint_f64_01( +; CHECK-NEXT: ret double 1.000000e+00 +; + %x = call double @rint(double 1.3) #0 + ret double %x +} + +define double @constant_fold_rint_f64_02() #0 { +; CHECK-LABEL: @constant_fold_rint_f64_02( +; CHECK-NEXT: ret double -1.000000e+00 +; + %x = call double @llvm.rint.f64(double -1.3) #0 + ret double %x +} + +define double @constant_fold_rint_f64_03() #0 { +; CHECK-LABEL: @constant_fold_rint_f64_03( +; CHECK-NEXT: ret double 2.000000e+00 +; + %x = call double @nearbyint(double 1.5) #0 + ret double %x +} + +define double @constant_fold_rint_f64_04() #0 { +; CHECK-LABEL: @constant_fold_rint_f64_04( +; CHECK-NEXT: ret double -2.000000e+00 +; + %x = call double @llvm.nearbyint.f64(double -1.5) #0 + ret double %x +} + +define double @constant_fold_rint_f64_05() #0 { +; CHECK-LABEL: @constant_fold_rint_f64_05( +; CHECK-NEXT: ret double 3.000000e+00 +; + %x = call double @rint(double 2.7) #0 + ret double %x +} + +define double @constant_fold_rint_f64_06() #0 { +; CHECK-LABEL: @constant_fold_rint_f64_06( +; CHECK-NEXT: ret double -3.000000e+00 +; + %x = call double @llvm.rint.f64(double -2.7) #0 + ret double %x +} + +attributes #0 = { nounwind readnone } diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/round.ll b/llvm/test/Transforms/InstSimplify/ConstProp/round.ll --- a/llvm/test/Transforms/InstSimplify/ConstProp/round.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/round.ll @@ -1,92 +1,92 @@ -; RUN: opt -S -early-cse < %s | FileCheck %s - -declare float @roundf(float) #0 -declare float @llvm.round.f32(float) #0 -declare double @round(double) #0 -declare double @llvm.round.f64(double) #0 - -; CHECK-LABEL: @constant_fold_round_f32_01 -; CHECK-NEXT: ret float 1.000000e+00 -define float @constant_fold_round_f32_01() #0 { - %x = call float @roundf(float 1.25) #0 - ret float %x -} - -; CHECK-LABEL: @constant_fold_round_f32_02 -; CHECK-NEXT: ret float -1.000000e+00 -define float @constant_fold_round_f32_02() #0 { - %x = call float @llvm.round.f32(float -1.25) #0 - ret float %x -} - -; CHECK-LABEL: @constant_fold_round_f32_03 -; CHECK-NEXT: ret float 2.000000e+00 -define float @constant_fold_round_f32_03() #0 { - %x = call float @roundf(float 1.5) #0 - ret float %x -} - -; CHECK-LABEL: @constant_fold_round_f32_04 -; CHECK-NEXT: ret float -2.000000e+00 -define float @constant_fold_round_f32_04() #0 { - %x = call float @llvm.round.f32(float -1.5) #0 - ret float %x -} - -; CHECK-LABEL: @constant_fold_round_f32_05 -; CHECK-NEXT: ret float 3.000000e+00 -define float @constant_fold_round_f32_05() #0 { - %x = call float @roundf(float 2.75) #0 - ret float %x -} - -; CHECK-LABEL: @constant_fold_round_f32_06 -; CHECK-NEXT: ret float -3.000000e+00 -define float @constant_fold_round_f32_06() #0 { - %x = call float @llvm.round.f32(float -2.75) #0 - ret float %x -} - -; CHECK-LABEL: @constant_fold_round_f64_01 -; CHECK-NEXT: ret double 1.000000e+00 -define double @constant_fold_round_f64_01() #0 { - %x = call double @round(double 1.3) #0 - ret double %x -} - -; CHECK-LABEL: @constant_fold_round_f64_02 -; CHECK-NEXT: ret double -1.000000e+00 -define double @constant_fold_round_f64_02() #0 { - %x = call double @llvm.round.f64(double -1.3) #0 - ret double %x -} - -; CHECK-LABEL: @constant_fold_round_f64_03 -; CHECK-NEXT: ret double 2.000000e+00 -define double @constant_fold_round_f64_03() #0 { - %x = call double @round(double 1.5) #0 - ret double %x -} - -; CHECK-LABEL: @constant_fold_round_f64_04 -; CHECK-NEXT: ret double -2.000000e+00 -define double @constant_fold_round_f64_04() #0 { - %x = call double @llvm.round.f64(double -1.5) #0 - ret double %x -} - -; CHECK-LABEL: @constant_fold_round_f64_05 -; CHECK-NEXT: ret double 3.000000e+00 -define double @constant_fold_round_f64_05() #0 { - %x = call double @round(double 2.7) #0 - ret double %x -} - -; CHECK-LABEL: @constant_fold_round_f64_06 -; CHECK-NEXT: ret double -3.000000e+00 -define double @constant_fold_round_f64_06() #0 { - %x = call double @llvm.round.f64(double -2.7) #0 - ret double %x -} - -attributes #0 = { nounwind readnone } +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s + +declare float @roundf(float) #0 +declare float @llvm.round.f32(float) #0 +declare double @round(double) #0 +declare double @llvm.round.f64(double) #0 + +; CHECK-LABEL: @constant_fold_round_f32_01 +; CHECK-NEXT: ret float 1.000000e+00 +define float @constant_fold_round_f32_01() #0 { + %x = call float @roundf(float 1.25) #0 + ret float %x +} + +; CHECK-LABEL: @constant_fold_round_f32_02 +; CHECK-NEXT: ret float -1.000000e+00 +define float @constant_fold_round_f32_02() #0 { + %x = call float @llvm.round.f32(float -1.25) #0 + ret float %x +} + +; CHECK-LABEL: @constant_fold_round_f32_03 +; CHECK-NEXT: ret float 2.000000e+00 +define float @constant_fold_round_f32_03() #0 { + %x = call float @roundf(float 1.5) #0 + ret float %x +} + +; CHECK-LABEL: @constant_fold_round_f32_04 +; CHECK-NEXT: ret float -2.000000e+00 +define float @constant_fold_round_f32_04() #0 { + %x = call float @llvm.round.f32(float -1.5) #0 + ret float %x +} + +; CHECK-LABEL: @constant_fold_round_f32_05 +; CHECK-NEXT: ret float 3.000000e+00 +define float @constant_fold_round_f32_05() #0 { + %x = call float @roundf(float 2.75) #0 + ret float %x +} + +; CHECK-LABEL: @constant_fold_round_f32_06 +; CHECK-NEXT: ret float -3.000000e+00 +define float @constant_fold_round_f32_06() #0 { + %x = call float @llvm.round.f32(float -2.75) #0 + ret float %x +} + +; CHECK-LABEL: @constant_fold_round_f64_01 +; CHECK-NEXT: ret double 1.000000e+00 +define double @constant_fold_round_f64_01() #0 { + %x = call double @round(double 1.3) #0 + ret double %x +} + +; CHECK-LABEL: @constant_fold_round_f64_02 +; CHECK-NEXT: ret double -1.000000e+00 +define double @constant_fold_round_f64_02() #0 { + %x = call double @llvm.round.f64(double -1.3) #0 + ret double %x +} + +; CHECK-LABEL: @constant_fold_round_f64_03 +; CHECK-NEXT: ret double 2.000000e+00 +define double @constant_fold_round_f64_03() #0 { + %x = call double @round(double 1.5) #0 + ret double %x +} + +; CHECK-LABEL: @constant_fold_round_f64_04 +; CHECK-NEXT: ret double -2.000000e+00 +define double @constant_fold_round_f64_04() #0 { + %x = call double @llvm.round.f64(double -1.5) #0 + ret double %x +} + +; CHECK-LABEL: @constant_fold_round_f64_05 +; CHECK-NEXT: ret double 3.000000e+00 +define double @constant_fold_round_f64_05() #0 { + %x = call double @round(double 2.7) #0 + ret double %x +} + +; CHECK-LABEL: @constant_fold_round_f64_06 +; CHECK-NEXT: ret double -3.000000e+00 +define double @constant_fold_round_f64_06() #0 { + %x = call double @llvm.round.f64(double -2.7) #0 + ret double %x +} + +attributes #0 = { nounwind readnone } diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/trunc.ll b/llvm/test/Transforms/InstSimplify/ConstProp/trunc.ll --- a/llvm/test/Transforms/InstSimplify/ConstProp/trunc.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/trunc.ll @@ -1,105 +1,105 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -early-cse < %s | FileCheck %s - -declare float @truncf(float) #0 -declare float @llvm.trunc.f32(float) #0 -declare double @trunc(double) #0 -declare double @llvm.trunc.f64(double) #0 - -define float @constant_fold_trunc_f32_01() #0 { -; CHECK-LABEL: @constant_fold_trunc_f32_01( -; CHECK-NEXT: ret float 1.000000e+00 -; - %x = call float @truncf(float 1.25) #0 - ret float %x -} - -define float @constant_fold_trunc_f32_02() #0 { -; CHECK-LABEL: @constant_fold_trunc_f32_02( -; CHECK-NEXT: ret float -1.000000e+00 -; - %x = call float @llvm.trunc.f32(float -1.25) #0 - ret float %x -} - -define float @constant_fold_trunc_f32_03() #0 { -; CHECK-LABEL: @constant_fold_trunc_f32_03( -; CHECK-NEXT: ret float 1.000000e+00 -; - %x = call float @truncf(float 1.5) #0 - ret float %x -} - -define float @constant_fold_trunc_f32_04() #0 { -; CHECK-LABEL: @constant_fold_trunc_f32_04( -; CHECK-NEXT: ret float -1.000000e+00 -; - %x = call float @llvm.trunc.f32(float -1.5) #0 - ret float %x -} - -define float @constant_fold_trunc_f32_05() #0 { -; CHECK-LABEL: @constant_fold_trunc_f32_05( -; CHECK-NEXT: ret float 2.000000e+00 -; - %x = call float @truncf(float 2.75) #0 - ret float %x -} - -define float @constant_fold_trunc_f32_06() #0 { -; CHECK-LABEL: @constant_fold_trunc_f32_06( -; CHECK-NEXT: ret float -2.000000e+00 -; - %x = call float @llvm.trunc.f32(float -2.75) #0 - ret float %x -} - -define double @constant_fold_trunc_f64_01() #0 { -; CHECK-LABEL: @constant_fold_trunc_f64_01( -; CHECK-NEXT: ret double 1.000000e+00 -; - %x = call double @trunc(double 1.3) #0 - ret double %x -} - -define double @constant_fold_trunc_f64_02() #0 { -; CHECK-LABEL: @constant_fold_trunc_f64_02( -; CHECK-NEXT: ret double -1.000000e+00 -; - %x = call double @llvm.trunc.f64(double -1.3) #0 - ret double %x -} - -define double @constant_fold_trunc_f64_03() #0 { -; CHECK-LABEL: @constant_fold_trunc_f64_03( -; CHECK-NEXT: ret double 1.000000e+00 -; - %x = call double @trunc(double 1.5) #0 - ret double %x -} - -define double @constant_fold_trunc_f64_04() #0 { -; CHECK-LABEL: @constant_fold_trunc_f64_04( -; CHECK-NEXT: ret double -1.000000e+00 -; - %x = call double @llvm.trunc.f64(double -1.5) #0 - ret double %x -} - -define double @constant_fold_trunc_f64_05() #0 { -; CHECK-LABEL: @constant_fold_trunc_f64_05( -; CHECK-NEXT: ret double 2.000000e+00 -; - %x = call double @trunc(double 2.7) #0 - ret double %x -} - -define double @constant_fold_trunc_f64_06() #0 { -; CHECK-LABEL: @constant_fold_trunc_f64_06( -; CHECK-NEXT: ret double -2.000000e+00 -; - %x = call double @llvm.trunc.f64(double -2.7) #0 - ret double %x -} - -attributes #0 = { nounwind readnone } +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s + +declare float @truncf(float) #0 +declare float @llvm.trunc.f32(float) #0 +declare double @trunc(double) #0 +declare double @llvm.trunc.f64(double) #0 + +define float @constant_fold_trunc_f32_01() #0 { +; CHECK-LABEL: @constant_fold_trunc_f32_01( +; CHECK-NEXT: ret float 1.000000e+00 +; + %x = call float @truncf(float 1.25) #0 + ret float %x +} + +define float @constant_fold_trunc_f32_02() #0 { +; CHECK-LABEL: @constant_fold_trunc_f32_02( +; CHECK-NEXT: ret float -1.000000e+00 +; + %x = call float @llvm.trunc.f32(float -1.25) #0 + ret float %x +} + +define float @constant_fold_trunc_f32_03() #0 { +; CHECK-LABEL: @constant_fold_trunc_f32_03( +; CHECK-NEXT: ret float 1.000000e+00 +; + %x = call float @truncf(float 1.5) #0 + ret float %x +} + +define float @constant_fold_trunc_f32_04() #0 { +; CHECK-LABEL: @constant_fold_trunc_f32_04( +; CHECK-NEXT: ret float -1.000000e+00 +; + %x = call float @llvm.trunc.f32(float -1.5) #0 + ret float %x +} + +define float @constant_fold_trunc_f32_05() #0 { +; CHECK-LABEL: @constant_fold_trunc_f32_05( +; CHECK-NEXT: ret float 2.000000e+00 +; + %x = call float @truncf(float 2.75) #0 + ret float %x +} + +define float @constant_fold_trunc_f32_06() #0 { +; CHECK-LABEL: @constant_fold_trunc_f32_06( +; CHECK-NEXT: ret float -2.000000e+00 +; + %x = call float @llvm.trunc.f32(float -2.75) #0 + ret float %x +} + +define double @constant_fold_trunc_f64_01() #0 { +; CHECK-LABEL: @constant_fold_trunc_f64_01( +; CHECK-NEXT: ret double 1.000000e+00 +; + %x = call double @trunc(double 1.3) #0 + ret double %x +} + +define double @constant_fold_trunc_f64_02() #0 { +; CHECK-LABEL: @constant_fold_trunc_f64_02( +; CHECK-NEXT: ret double -1.000000e+00 +; + %x = call double @llvm.trunc.f64(double -1.3) #0 + ret double %x +} + +define double @constant_fold_trunc_f64_03() #0 { +; CHECK-LABEL: @constant_fold_trunc_f64_03( +; CHECK-NEXT: ret double 1.000000e+00 +; + %x = call double @trunc(double 1.5) #0 + ret double %x +} + +define double @constant_fold_trunc_f64_04() #0 { +; CHECK-LABEL: @constant_fold_trunc_f64_04( +; CHECK-NEXT: ret double -1.000000e+00 +; + %x = call double @llvm.trunc.f64(double -1.5) #0 + ret double %x +} + +define double @constant_fold_trunc_f64_05() #0 { +; CHECK-LABEL: @constant_fold_trunc_f64_05( +; CHECK-NEXT: ret double 2.000000e+00 +; + %x = call double @trunc(double 2.7) #0 + ret double %x +} + +define double @constant_fold_trunc_f64_06() #0 { +; CHECK-LABEL: @constant_fold_trunc_f64_06( +; CHECK-NEXT: ret double -2.000000e+00 +; + %x = call double @llvm.trunc.f64(double -2.7) #0 + ret double %x +} + +attributes #0 = { nounwind readnone } diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/vscale-getelementptr.ll b/llvm/test/Transforms/InstSimplify/ConstProp/vscale-getelementptr.ll --- a/llvm/test/Transforms/InstSimplify/ConstProp/vscale-getelementptr.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/vscale-getelementptr.ll @@ -1,32 +1,32 @@ -; RUN: opt -early-cse -S < %s | FileCheck %s - -target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" -target triple = "aarch64" - -; CHECK-LABEL: define <4 x i32*> @fixed_length_version_first() { -; CHECK-NEXT: ret <4 x i32*> undef -define <4 x i32*> @fixed_length_version_first() { - %ptr = getelementptr i32, <4 x i32*> undef, <4 x i64> undef - ret <4 x i32*> %ptr -} - -; CHECK-LABEL: define <4 x <4 x i32>*> @fixed_length_version_second() { -; CHECK-NEXT: ret <4 x <4 x i32>*> undef -define <4 x <4 x i32>*> @fixed_length_version_second() { - %ptr = getelementptr <4 x i32>, <4 x i32>* undef, <4 x i64> undef - ret <4 x <4 x i32>*> %ptr -} - -; CHECK-LABEL: define @vscale_version_first() { -; CHECK-NEXT: ret undef -define @vscale_version_first() { - %ptr = getelementptr i32, undef, undef - ret %ptr -} - -; CHECK-LABEL: define *> @vscale_version_second() { -; CHECK-NEXT: ret *> undef -define *> @vscale_version_second() { - %ptr = getelementptr , * undef, undef - ret *> %ptr -} +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s + +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" +target triple = "aarch64" + +; CHECK-LABEL: define <4 x i32*> @fixed_length_version_first() { +; CHECK-NEXT: ret <4 x i32*> undef +define <4 x i32*> @fixed_length_version_first() { + %ptr = getelementptr i32, <4 x i32*> undef, <4 x i64> undef + ret <4 x i32*> %ptr +} + +; CHECK-LABEL: define <4 x <4 x i32>*> @fixed_length_version_second() { +; CHECK-NEXT: ret <4 x <4 x i32>*> undef +define <4 x <4 x i32>*> @fixed_length_version_second() { + %ptr = getelementptr <4 x i32>, <4 x i32>* undef, <4 x i64> undef + ret <4 x <4 x i32>*> %ptr +} + +; CHECK-LABEL: define @vscale_version_first() { +; CHECK-NEXT: ret undef +define @vscale_version_first() { + %ptr = getelementptr i32, undef, undef + ret %ptr +} + +; CHECK-LABEL: define *> @vscale_version_second() { +; CHECK-NEXT: ret *> undef +define *> @vscale_version_second() { + %ptr = getelementptr , * undef, undef + ret *> %ptr +} diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/vscale-shufflevector.ll b/llvm/test/Transforms/InstSimplify/ConstProp/vscale-shufflevector.ll --- a/llvm/test/Transforms/InstSimplify/ConstProp/vscale-shufflevector.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/vscale-shufflevector.ll @@ -1,4 +1,4 @@ -; RUN: opt -early-cse -S < %s | FileCheck %s +; RUN: opt -early-cse -earlycse-debug-hash -S < %s | FileCheck %s target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target triple = "aarch64" diff --git a/llvm/test/Transforms/NaryReassociate/NVPTX/nary-gep.ll b/llvm/test/Transforms/NaryReassociate/NVPTX/nary-gep.ll --- a/llvm/test/Transforms/NaryReassociate/NVPTX/nary-gep.ll +++ b/llvm/test/Transforms/NaryReassociate/NVPTX/nary-gep.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -nary-reassociate -early-cse -S | FileCheck %s +; RUN: opt < %s -nary-reassociate -early-cse -earlycse-debug-hash -S | FileCheck %s ; RUN: opt < %s -passes='nary-reassociate' -S | opt -early-cse -S | FileCheck %s target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64" diff --git a/llvm/test/Transforms/Reassociate/cse-pairs.ll b/llvm/test/Transforms/Reassociate/cse-pairs.ll --- a/llvm/test/Transforms/Reassociate/cse-pairs.ll +++ b/llvm/test/Transforms/Reassociate/cse-pairs.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -reassociate -early-cse -S < %s | FileCheck %s +; RUN: opt -reassociate -early-cse -earlycse-debug-hash -S < %s | FileCheck %s @num1 = local_unnamed_addr global i32 0, align 4 @num2 = local_unnamed_addr global i32 0, align 4