Displaying 4 results from an estimated 4 matches for "__ubsan_handle_divrem_overflow".
2013 Apr 08
1
[LLVMdev] Integer divide by zero
...; there is a way. ;)
>
I've tried my little test case with an unmodified Clang
and -fsanitize=integer-divide-by-zero. After LLVM runs the Function
Integration/Inlining Pass, I end up with this IR:
*** IR Dump Before Deduce function attributes ***
define i32 @main() #0 {
entry:
call void @__ubsan_handle_divrem_overflow(i8* bitcast ({ { i8*, i32, i32
}, { i16, i16, [6 x i8] }* }* @2 to i8*), i64 6, i64 0) #3
%call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x
i8]* @.str, i64 0, i64 0), i32 undef) #3
ret i32 0
}
The problem I'm facing is how to safely convert this
__ubsan_handle_divrem_o...
2013 Apr 08
0
[LLVMdev] Integer divide by zero
Hey Duncan,
On Mon, Apr 8, 2013 at 3:39 AM, Duncan Sands <baldrick at free.fr> wrote:
...
> I reckon it shouldn't be too hard to teach the code generators to turn
> this IR
> sequence into "y = target-divide whatever/x" on targets for which dividing
> by 0
> traps in a satisfactory way, so it turns into something efficient.
>
I was just writing Chandler
2013 Apr 08
3
[LLVMdev] Integer divide by zero
Hi Cameron,
On 07/04/13 19:42, Cameron McInally wrote:
> On Sun, Apr 7, 2013 at 1:23 PM, Duncan Sands <baldrick at free.fr
> <mailto:baldrick at free.fr>> wrote:
> ...
>
> If you want a trap you are going to have to (IMO) output IR
> instructions rather than a constant expression. For example you can output the
> equivalent of
> if (x == 0)
2018 Aug 02
2
SCEVUDiv simplification
Hello,
I noticed that our SCEVUDiv does not simplify anything when the RHS is not
a constant.
Is that because there is a potential issue with division by zero being
simplified?
For instance, would it be okay to simplify:
((%i * %n)<nuw> /u %n)
into: %i
The way I see it, if %n is 0, then that division is undefined and we can
"define it", at will, as being %i.
Would that make