[LLVMdev] InstCombine "pessimizes" trunc i8 to i1?

Gordon Keiser gkeiser at arxan.com
Fri Dec 30 11:26:21 PST 2011


Clang does treat bools as i1 in the IR output if you include stdbool.   I had an issue a while back where I needed a function to return an i1 after compilation, and moving to Clang and including stdbool solved it (and it was Samuel who suggested it then as well,  so thanks again :-)  )

-Gordon

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Samuel Crow
Sent: Friday, December 30, 2011 12:34 PM
To: Jochen Wilhelmy; Reid Kleckner
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] InstCombine "pessimizes" trunc i8 to i1?

> By the way i8 and trunc come from clang as clang represents a bool as 
> i8

> in memory. of course it would
> be a nice feature if I could tell clang to always use i1 for bool, 
> this would also remove the problem.
> Is this possible?
> 
> -Jochen


#include <stdbool.h> ?


_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list