From 0001e56f15215ae4bc5fffb82eec5c4828b888f0 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 24 Feb 2009 02:00:40 +0000 Subject: Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simple ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65364 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/ashr-nop.ll | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/Transforms/InstCombine/ashr-nop.ll (limited to 'test/Transforms/InstCombine/ashr-nop.ll') diff --git a/test/Transforms/InstCombine/ashr-nop.ll b/test/Transforms/InstCombine/ashr-nop.ll new file mode 100644 index 0000000000..bb0da346b0 --- /dev/null +++ b/test/Transforms/InstCombine/ashr-nop.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ashr + +define i32 @foo(i32 %x) { + %o = and i32 %x, 1 + %n = add i32 %o, -1 + %t = ashr i32 %n, 17 + ret i32 %t +} -- cgit v1.2.3