mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-22 07:32:48 +00:00
32a43cc0fc
using BinaryOperator (which only works for instructions) when it should have been a cast to OverflowingBinaryOperator (which also works for constants). While there, correct a few other dubious looking uses of BinaryOperator. Thanks to Chad Rosier for the testcase. Original commit message: My super-optimizer noticed that we weren't folding this expression to true: (x *nsw x) sgt 0, where x = (y | 1). This occurs in 464.h264ref. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143125 91177308-0d34-0410-b5e6-96231b3b80d8
13 lines
945 B
LLVM
13 lines
945 B
LLVM
; RUN: opt < %s -instcombine
|
|
|
|
@_ZN11xercesc_2_5L11gDigitCharsE = external constant [32 x i16], align 2
|
|
@_ZN11xercesc_2_5L10gBaseCharsE = external constant [354 x i16], align 2
|
|
@_ZN11xercesc_2_5L17gIdeographicCharsE = external constant [7 x i16], align 2
|
|
@_ZN11xercesc_2_5L15gCombiningCharsE = external constant [163 x i16], align 2
|
|
|
|
define i32 @_ZN11xercesc_2_515XMLRangeFactory11buildRangesEv(i32 %x) {
|
|
%a = add i32 %x, add (i32 add (i32 ashr (i32 add (i32 mul (i32 ptrtoint ([32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE, i32 0, i32 30) to i32)), i32 1), i32 ashr (i32 add (i32 mul (i32 ptrtoint ([7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE, i32 0, i32 4) to i32)), i32 1)), i32 8)
|
|
%b = add i32 %a, %x
|
|
ret i32 %b
|
|
}
|