search for: islegalinteg

Displaying 14 results from an estimated 14 matches for "islegalinteg".

Did you mean: islegalinteger
2017 Jan 31
2
Folding zext from i1 into PHI nodes with only zwo incoming values.
...al to an illegal type or from a > smaller > +/// to a larger illegal type. Width of '1' is always treated as a legal > type. > bool InstCombiner::ShouldChangeType(unsigned FromWidth, > unsigned ToWidth) const { > - bool FromLegal = DL.isLegalInteger(FromWidth); > - bool ToLegal = DL.isLegalInteger(ToWidth); > + bool FromLegal = FromWidth == 1 ? true : DL.isLegalInteger(FromWidth); > + bool ToLegal = ToWidth == 1 ? true : DL.isLegalInteger(ToWidth); > > // If this is a legal integer from type, and the result would be an &...
2017 Jan 31
0
Folding zext from i1 into PHI nodes with only zwo incoming values.
...from a >> smaller >> +/// to a larger illegal type. Width of '1' is always treated as a legal >> type. >> bool InstCombiner::ShouldChangeType(unsigned FromWidth, >> unsigned ToWidth) const { >> - bool FromLegal = DL.isLegalInteger(FromWidth); >> - bool ToLegal = DL.isLegalInteger(ToWidth); >> + bool FromLegal = FromWidth == 1 ? true : DL.isLegalInteger(FromWidth); >> + bool ToLegal = ToWidth == 1 ? true : DL.isLegalInteger(ToWidth); >> >> // If this is a legal integer from type, and the...
2017 Jan 31
1
Folding zext from i1 into PHI nodes with only zwo incoming values.
...ller >>> +/// to a larger illegal type. Width of '1' is always treated as a legal >>> type. >>> bool InstCombiner::ShouldChangeType(unsigned FromWidth, >>> unsigned ToWidth) const { >>> - bool FromLegal = DL.isLegalInteger(FromWidth); >>> - bool ToLegal = DL.isLegalInteger(ToWidth); >>> + bool FromLegal = FromWidth == 1 ? true : DL.isLegalInteger(FromWidth); >>> + bool ToLegal = ToWidth == 1 ? true : DL.isLegalInteger(ToWidth); >>> >>> // If this is a legal integer...
2017 Jan 30
0
Folding zext from i1 into PHI nodes with only zwo incoming values.
...9;t want to convert from a legal to an illegal type or from a smaller +/// to a larger illegal type. Width of '1' is always treated as a legal type. bool InstCombiner::ShouldChangeType(unsigned FromWidth, unsigned ToWidth) const { - bool FromLegal = DL.isLegalInteger(FromWidth); - bool ToLegal = DL.isLegalInteger(ToWidth); + bool FromLegal = FromWidth == 1 ? true : DL.isLegalInteger(FromWidth); + bool ToLegal = ToWidth == 1 ? true : DL.isLegalInteger(ToWidth); // If this is a legal integer from type, and the result would be an illegal // type, don...
2017 Jan 30
3
Folding zext from i1 into PHI nodes with only zwo incoming values.
Hi Sanjay, unfortunately that patch does not help in my case. Here's the IR that fails to get fully optimized: target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" define fastcc zeroext i1 @testfunc(i8** noalias nocapture readonly dereferenceable(8)) unnamed_addr { entry-block: %1 = load i8*, i8**
2015 Jul 01
3
[LLVMdev] Deriving undefined behavior from nsw/inbounds/poison for scalar evolution
----- Original Message ----- > From: "Bjarke Roune" <broune at google.com> > To: "Jingyue Wu" <jingyue at google.com> > Cc: llvmdev at cs.uiuc.edu > Sent: Tuesday, June 30, 2015 8:16:13 PM > Subject: Re: [LLVMdev] Deriving undefined behavior from nsw/inbounds/poison for scalar evolution > > Hi Adam, > > Jingyue is right. We need to keep
2015 Jul 01
2
[LLVMdev] Deriving undefined behavior from nsw/inbounds/poison for scalar evolution
...h integers bigger than 64-bits. > // Also avoid creating IVs of non-native types. For example, we > don't want a // 64-bit IV in 32-bit code just because the loop has > one 64-bit cast. uint64_t Width = SE -> getTypeSizeInBits ( I -> > getType ()); if ( Width > 64 || ! DL . isLegalInteger ( Width )) > return false ; > > > When I wrote "we need to keep things in 32 bits", I meant that some > 32 bit induction variables should stay in 32 bits, but we do want 64 > bit induction variables in some common cases. The usual such case is > for pointer induct...
2018 Jan 22
2
always allow canonicalizing to 8- and 16-bit ops?
...results. > > Using this patch: > > --- a/lib/Transforms/InstCombine/InstructionCombining.cpp > +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp > @@ -150,6 +150,9 @@ bool InstCombiner::shouldChangeType(unsigned > FromWidth, > bool FromLegal = FromWidth == 1 || DL.isLegalInteger(FromWidth); > bool ToLegal = ToWidth == 1 || DL.isLegalInteger(ToWidth); > > + if (FromLegal && ToWidth < FromWidth && (ToWidth == 8 || ToWidth == 16)) > + return true; > + > // If this is a legal integer from type, and the result would be an > il...
2018 Jan 22
0
always allow canonicalizing to 8- and 16-bit ops?
...run some benchmarks and look at that results. Using this patch: --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -150,6 +150,9 @@ bool InstCombiner::shouldChangeType(unsigned FromWidth, bool FromLegal = FromWidth == 1 || DL.isLegalInteger(FromWidth); bool ToLegal = ToWidth == 1 || DL.isLegalInteger(ToWidth); + if (FromLegal && ToWidth < FromWidth && (ToWidth == 8 || ToWidth == 16)) + return true; + // If this is a legal integer from type, and the result would be an illegal // type, don't do th...
2018 Jan 17
3
always allow canonicalizing to 8- and 16-bit ops?
Example: define i8 @narrow_add(i8 %x, i8 %y) { %x32 = zext i8 %x to i32 %y32 = zext i8 %y to i32 %add = add nsw i32 %x32, %y32 %tr = trunc i32 %add to i8 ret i8 %tr } With no data-layout or with an x86 target where 8-bit integer is in the data-layout, we reduce to: $ ./opt -instcombine narrowadd.ll -S define i8 @narrow_add(i8 %x, i8 %y) { %add = add i8 %x, %y ret i8 %add } But on
2012 Dec 04
1
[LLVMdev] What does LLVM ERROR: Cannot select.. mean?
Am Montag, den 03.12.2012, 17:40 -0600 schrieb Krzysztof Parzyszek: > On 12/3/2012 5:07 PM, Roman Kennke wrote: > > Hello, > > > > I am currently working on Shark, a backend for the Hotspot VM of > > OpenJDK, which uses LLVM to generate target machine code. > > > > I am currently running into an LLVM error message, and I don't know > > exactly what
2015 Apr 23
2
[LLVMdev] RFC: Missing canonicalization in LLVM
...ever stored to operate over // integers instead of any other type. We only do this when the loaded type // is sized and has a size exactly the same as its store size and the store // size is a legal integer type. if (!Ty->isIntegerTy() && Ty->isSized() && DL.isLegalInteger(DL.getTypeStoreSizeInBits(Ty)) && DL.getTypeStoreSizeInBits(Ty) == DL.getTypeSizeInBits(Ty)) { if (std::all_of(LI.user_begin(), LI.user_end(), [&LI](User *U) { auto *SI = dyn_cast<StoreInst>(U); return SI && SI->getPointerOperand() !=...
2015 Apr 21
2
[LLVMdev] RFC: Missing canonicalization in LLVM
So this change did indeed have an effect! :) I’m seeing regressions in a number of benchmarks mainly due to a host of extra bitcasts that get introduced. Here’s the problem I’m seeing in a nutshell: 1) There is a Phi with input type double 2) Polly demotes the phi into a load/store of type double 3) InstCombine canonicalizes the load/store to use i64 instead of double 4)
2018 Jan 23
0
MachineVerifier and undef
...that results. > > Using this patch: > > --- a/lib/Transforms/InstCombine/InstructionCombining.cpp > +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp > @@ -150,6 +150,9 @@ bool InstCombiner::shouldChangeType(unsigned FromWidth, > bool FromLegal = FromWidth == 1 || DL.isLegalInteger(FromWidth); > bool ToLegal = ToWidth == 1 || DL.isLegalInteger(ToWidth); > > + if (FromLegal && ToWidth < FromWidth && (ToWidth == 8 || ToWidth == 16)) > + return true; > + > // If this is a legal integer from type, and the result would be an > il...